The color.invert function doesn't modify the colour.
In addition, I'd love to see some extra functions for manipulating colours!
color.hue.set(color, hue)
Sets the color's hue with the HSV color model, preserving the saturation and value of the provided color. Hue is a value between 0 and 100.
color.hue.get(color)
Gets the color's hue, between 0 and 100.
color.hue.shift(color, hue)
Offsets the color's hue with the HSV color model. Hue is a value between 0 and 100. Will wrap values that are out of bounds.
color.saturation.set(color, saturation)
Sets the color's saturation with the HSV color model, preserving the hue and value of the provided color. Saturation is a value between 0 and 100.
color.saturation.get(color)
Gets the color's saturation, between 0 and 100.
color.saturation.shift(color, saturation)
Offsets the color's saturation with the HSV color model. Saturation is a value between 0 and 100. Will clamp values that are out of bounds.
Note: This is very similar to the color.dark & color.light functions, which I believe should/could be aliased to color.darken & color.lighten as these names are clearer.
color.value.set(color, value)
Sets the color's value with the HSV color model, preserving the hue and saturation of the provided color. Value is a value between 0 and 100.
color.value.get(color)
Gets the color's value, between 0 and 100.
color.value.shift(color, value)
Offsets the color's value with the HSV color model. Value is a value between 0 and 100. Will clamp values that are out of bounds.
color.lerp(a, b, amount)
Mixes the two colors by lerping their RGB components by amount. Amount is a value between 0 and 100.
color.add(a, b)
Combines the two colors by adding their individual components. Opacity is not modified.
color.multiply(a, b)
Combines the two colors by multiplying their individual components. Opacity is not modified.
Also, as an extra ask, something rarely implemented in other tools: CIELAB color functions.
This is an extremely useful color model, particularly as it can provide consistent preceived lightness between different hues and chrominance (color intensity).
The names of the functions color.dark and color.light have been modified to color.darken and color.lighten while keeping the old names until they are deprecated.
The
color.invert
function doesn't modify the colour. In addition, I'd love to see some extra functions for manipulating colours!color.hue.set(color, hue)
Sets the color's hue with the HSV color model, preserving the saturation and value of the provided color. Hue is a value between
0
and100
.color.hue.get(color)
Gets the color's hue, between
0
and100
.color.hue.shift(color, hue)
Offsets the color's hue with the HSV color model. Hue is a value between
0
and100
. Will wrap values that are out of bounds.color.saturation.set(color, saturation)
Sets the color's saturation with the HSV color model, preserving the hue and value of the provided color. Saturation is a value between
0
and100
.color.saturation.get(color)
Gets the color's saturation, between
0
and100
.color.saturation.shift(color, saturation)
Offsets the color's saturation with the HSV color model. Saturation is a value between
0
and100
. Will clamp values that are out of bounds. Note: This is very similar to thecolor.dark
&color.light
functions, which I believe should/could be aliased tocolor.darken
&color.lighten
as these names are clearer.color.value.set(color, value)
Sets the color's value with the HSV color model, preserving the hue and saturation of the provided color. Value is a value between
0
and100
.color.value.get(color)
Gets the color's value, between
0
and100
.color.value.shift(color, value)
Offsets the color's value with the HSV color model. Value is a value between
0
and100
. Will clamp values that are out of bounds.color.lerp(a, b, amount)
Mixes the two colors by lerping their RGB components by
amount
. Amount is a value between0
and100
.color.add(a, b)
Combines the two colors by adding their individual components. Opacity is not modified.
color.multiply(a, b)
Combines the two colors by multiplying their individual components. Opacity is not modified.
Also, as an extra ask, something rarely implemented in other tools: CIELAB color functions. This is an extremely useful color model, particularly as it can provide consistent preceived lightness between different hues and chrominance (color intensity).
Here's the sort of thing I have in mind:
color.lab.lightness.[set|get]
color.lab.chroma.[set|get]
color.lab.hue.[set|get]
See: Color Picker & Code