Back Discord Discord
Open Repo
Matugen Header

Matugen

A cross-platform material you and base16 color generation tool

Filters

set_red

Sets the red channel of a color

{{ "#000000" | to_color | set_red: 255 }}

Arguments:

  • Int - the red channel value (0-255)

set_blue

Sets the blue channel of a color

{{ "#000000" | to_color | set_blue: 255 }}

Arguments:

  • Int - the blue channel value

set_green

Sets the green channel of a color

{{ "#000000" | to_color | set_green: 255 }}

Arguments:

  • Int - the green channel value (0-255)

set_alpha

Sets the alpha channel of a color

{{ "#000000" | to_color | set_alpha: 0.1 }}

Arguments:

  • Float - the alpha channel value (0.0-1.0)

set_hue

Sets the hue channel of a color

{{ "#000000" | to_color | set_hue: 360 }}

Arguments:

  • Int - the hue value (0-360)

set_saturation

Sets the saturation of a color

{{ "#000000" | to_color | set_saturation: 100.0 }}

Arguments:

  • Float - the saturation value (0-100)

set_lightness

Sets the lightness of a color

{{ "#000000" | to_color | set_lightness: 100 }}

Arguments:

  • Int - the lightness value (0-100)

lighten

Lightens a color

{{ "#ffffff" | to_color | lighten: 20.0 }}

Arguments:

  • Float - amount to adjust lightness by

to_color

Parses a CSS color string into a color

{{ "#ff00ff" | to_color }}

invert

Inverts a color

{{ "#ffffff" | to_color | invert }}

grayscale

Converts a color to grayscale

{{ "#ff0000" | to_color | grayscale }}

auto_lightness

Automatically lightens or darkens a color based on its current lightness If the color is dark, it will be lightened. If it is light, it will be darkened.

{{ "#222222" | to_color | auto_lightness: 10.0 }}

Arguments:

  • Float - amount to adjust lightness by

saturate

Adjusts the saturation of a color

{{ "#336699" | to_color | saturate: 20.0, "hsl" }}

Arguments:

  • Float - saturation amount
  • String - color space (hsl or hsv)

blend

Blends two colors together using hue blending

{{ "#ff0000" | to_color | blend: {{ "#0000ff" | to_color }}, 0.5 }}

Arguments:

  • Color - color to blend with
  • Float - blend amount (0.0 - 1.0)

harmonize

Harmonizes a color with another using harmonization This shifts the hue of the original color toward the target color.

{{ "#ff0000" | to_color | harmonize: {{ "#00ff00" | to_color }}

Arguments:

  • Color - color to harmonize with

format

Formats a color into a certain format just like what using the .format on a color keyword would. This is useful for colors that are defined in the templates as there is no way to format them otherwise.

{{ "#ff00ff" | format: "hex" }}

Arguments:

  • String - what to format the color into

snake_case

Converts a value to snake_case

{{ "Hello World" | snake_case }}

lower_case

Converts a value to lowercase

{{ "Hello World" | lower_case }}

camel_case

Converts a value to camelCase

{{ "hello world" | camel_case }}

pascal_case

Converts a value to PascalCase

{{ "hello world" | pascal_case }}

kebab_case

Converts a value to kebab-case

{{ "hello world" | kebab_case }}

replace

Replaces all occurrences of a substring

{{ "hello world" | replace: "world", "there" }}

Arguments:

  • String - text to find
  • String - replacement text