claritas v0.1.0 Claritas
Claritas lighten or darken color (hexadecimal) by integer value.
Link to this section Summary
Functions
Shift brightness (up or down) of the given hexadecimal color
by integer value brightness_change
.
Link to this section Functions
Link to this function
shift(color, brightness_change)
Shift brightness (up or down) of the given hexadecimal color
by integer value brightness_change
.
Parameters:
color
: color in hexadecimal format (#RRGGBB)
brightness_change
: integer value
Examples
# positive values are lightening the color
iex> Claritas.shift("#f06d06", 30)
{:ok, "#FF8B24"}
# negative values are darkening the color
iex> Claritas.shift("#f06d06", -30)
{:ok, "#D24F00"}
Dynamically increase/decrease brightness of your colors.
style='background-color: <%= Claritas.shift("#f06d06", @calculated_value) %>'