@register.inclusion_tag("color_value.html")
def color_value(collection):
		
	if not collection:
		return {"valid":False}
	
	if not isinstance(collection,dict):
		return {"valid":True, "text":collection, "color":None, "debug":collection}
	
	if not collection or "value" not in collection:
		return {"valid":False}
	
	value = collection["value"]
	color = collection.get("textcolor", None)
	
	if callable(color):
		(value, color) = color(value, collection)
	
	args = {
			"valid":True,
			"text":value, 
			"color":color,
			"debug":(value, color, collection.get("color", None), collection.get("values",None))
			}
	if "link" in collection:
		args["link"] = collection["link"];
	
	return args
{% color_value collection %}
dataset/ETHPy150Open operasoftware/tlsprober/probedb/probedata2/templatetags/tags.py/color_value