AKPlan.templatetags.color_gradients module
- AKPlan.templatetags.color_gradients.hex_to_rgb(hex)[source]
Convert hex color to RGB color code :param hex: hex encoded color :type hex: str :return: rgb encoded version of given color :rtype: list[int]
- AKPlan.templatetags.color_gradients.rgb_to_hex(rgb)[source]
Convert rgb color (list) to hex encoding (str) :param rgb: rgb encoded color :type rgb: list[int] :return: hex encoded version of given color :rtype: str
- AKPlan.templatetags.color_gradients.linear_blend(start_hex, end_hex, position)[source]
Create a linear blend between two colors and return color code on given position of the range from 0 to 1 :param start_hex: hex representation of start color :type start_hex: str :param end_hex: hex representation of end color :type end_hex: str :param position: position in range from 0 to 1 :type position: float :return: hex encoded interpolated color :rtype: str