askama/testing/templates/match-custom-enum.html
2018-12-12 21:48:41 +01:00

9 lines
321 B
HTML

{% match color %}
{% when Color::Rgb with {r, g: g, b: blue} %}
Colorful: #{{ "{:02X}"|format(r) }}{{ "{:02X}"|format(g) }}{{ "{:02X}"|format(blue) }}
{% when Color::GrayScale with (val) %}
Gray: #{{ "{:02X}"|format(val) }}{{ "{:02X}"|format(val) }}{{ "{:02X}"|format(val) }}
{% else %}
CMYK not supported
{% endmatch %}