shuup.xtheme.templatetags package

Submodules

shuup.xtheme.templatetags.xtheme_tags module

Module contents

shuup.xtheme.templatetags.clamp(val, minimum=0, maximum=255)[source]
shuup.xtheme.templatetags.colorscale(hexstr, scalefactor)[source]

Scales a hex string by scalefactor. Returns scaled hex string.

To darken the color, use a float value between 0 and 1. To brighten the color, use a float value greater than 1.

>>> colorscale("#DF3C3C", .5)
#6F1E1E
>>> colorscale("#52D24F", 1.6)
#83FF7E
>>> colorscale("#4F75D2", 1)
#4F75D2