color_to_hex
Converts a rgb color string to hexadecimal format (hex6
).
Input
{{ 'rgb(234, 90, 185)' | color_to_hex }}
Output
#EA5AB9
color_to_rgb
Converts a hex color string to rgba format.
Input
{{ "#EA5AB9" | color_to_rgb}}
Output
rgb(234, 90, 185)
color_to_hsl
Converts a hex color string to hsl format.
Input
{{ "#EA5AB9" | color_to_hsl}}
Output
hsl(320, 77%, 64%)
hex_to_rgba
Converts a hex color string to rgba format, default alpha is 1.0
Input
{{ '#EA5AB9' | hex_to_rgba: 0.5 }}
Output
rgba(234, 90, 185, 0.5)
Input
{{ '#EA5AB9' | hex_to_rgba }}
Output
rgba(234, 90, 185, 1.0)