Skip to content

Filters

ini edited this page Mar 26, 2024 · 3 revisions

Filters

All filters available:

replace

{{ "foo" | replace: "foo", "bar" }}
<* for name, value in colors *>
    {{name | replace: "_", "-" }} {{value.default.hex}};
<* endfor *>

This will replace _ with - for every color.

For example: surface_dim -> surface-dim.

to_lower

{{ "TEST" | to_lower }}

to_upper

{{ "test" | to_upper }}

set_lightness

Increases/Decreases lightness of the provided color. Can be used on normal strings and color keywords too. Automatically gets the format from the string and outputs it as the same one.

{{ "#ffbf9b" | set_lightness: 10.0}}
{{ "rgb(255,255,255)" | set_lightness: 10.0}}

{{ colors.source_color.default.rgb | set_lightness: 20.0 }}
{{ colors.source_color.default.rgb | set_lightness: -20.0 }}
Clone this wiki locally