Utilities for color creation, conversion, and manipulation.
Utilities for color creation, conversion, and manipulation.
(analogous color)
(analogous color clockwise?)
Given a color return a triple of colors which are 0, 30, and 60 degrees clockwise from it. If a second falsy argument is passed the returned values will be in a counter-clockwise direction.
Given a color return a triple of colors which are 0, 30, and 60 degrees clockwise from it. If a second falsy argument is passed the returned values will be in a counter-clockwise direction.
(as-hex x)
Convert a color to a hexadecimal string.
Convert a color to a hexadecimal string.
(as-hsla color)
Converts a color to HSLA. Assumes an alpha value of 1.00 unless one is currently set on color.
Converts a color to HSLA. Assumes an alpha value of 1.00 unless one is currently set on color.
(color* a)
(color* a b)
(color* a b & more)
Multiply the RGB components of two or more colors.
Multiply the RGB components of two or more colors.
(color+ a)
(color+ a b)
(color+ a b & more)
Add the RGB components of two or more colors.
Add the RGB components of two or more colors.
(color- a)
(color- a b)
(color- a b & more)
Subtract the RGB components of two or more colors.
Subtract the RGB components of two or more colors.
(color-div a)
(color-div a b)
(color-div a b & more)
Divide the RGB components of two or more colors.
Divide the RGB components of two or more colors.
(complement color)
Return the complement of a color.
Return the complement of a color.
(darken color amount)
Decrease the lightness value a given color by amount.
Decrease the lightness value a given color by amount.
(desaturate color amount)
Decrease the saturation value of a given color by amount.
Decrease the saturation value of a given color by amount.
(from-name n)
Given a CSS color name n return an instance of CSSColor.
Given a CSS color name n return an instance of CSSColor.
(hex->hsl color)
Convert a hexadecimal color to an HSL color.
Convert a hexadecimal color to an HSL color.
(hex->rgb s)
Convert a hexadecimal color to an RGB color map.
Convert a hexadecimal color to an RGB color map.
Regular expression for matching a hexadecimal color. Matches hexadecimal colors of length three or six possibly lead by a "#". The color portion is captured.
Regular expression for matching a hexadecimal color. Matches hexadecimal colors of length three or six possibly lead by a "#". The color portion is captured.
(hex? x)
Returns true if x is a hexadecimal color.
Returns true if x is a hexadecimal color.
(hsl->hex color)
Convert an HSL color map to a hexadecimal string.
Convert an HSL color map to a hexadecimal string.
(hsl->rgb {:keys [hue saturation lightness] :as color})
Convert an HSL color map to an RGB color map.
Convert an HSL color map to an RGB color map.
(hsl? color)
Return true if color is an HSL color.
Return true if color is an HSL color.
(hsla [h s l a])
(hsla h s l a)
Create an HSLA color.
Create an HSLA color.
(hsla? color)
Return true if color is an HSLA color.
Return true if color is an HSLA color.
(invert color)
Return the inversion of a color.
Return the inversion of a color.
(lighten color amount)
Increase the lightness value a given color by amount.
Increase the lightness value a given color by amount.
(mix color-1 color-2)
(mix color-1 color-2 & more)
Mix two or more colors by averaging their RGB channels.
Mix two or more colors by averaging their RGB channels.
(opacify color amount)
Increases the alpha value of a given color by amount.
Increases the alpha value of a given color by amount.
(rgb [r g b :as vs])
(rgb r g b)
Create an RGB color.
Create an RGB color.
(rgb->hex {r :red g :green b :blue})
Convert an RGB color map to a hexadecimal color.
Convert an RGB color map to a hexadecimal color.
(rgb->hsl {:keys [red green blue] :as color})
Convert an RGB color map to an HSL color map.
Convert an RGB color map to an HSL color map.
(rgb? color)
Return true if color is an RGB color.
Return true if color is an RGB color.
(rgba [r g b a])
(rgba r g b a)
Create an RGBA color.
Create an RGBA color.
(rotate-hue color amount)
Rotates the hue value of a given color by amount.
Rotates the hue value of a given color by amount.
(saturate color amount)
Increase the saturation value of a given color by amount.
Increase the saturation value of a given color by amount.
(scale-alpha color amount)
Scales the alpha of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
Scales the alpha of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
(scale-lightness color amount)
Scales the lightness of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
Scales the lightness of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
(scale-saturation color amount)
Scales the saturation of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
Scales the saturation of a color by amount, which is treated as a percentage. Supply positive values to scale upwards and negative values to scale downwards.
(shades color)
(shades color step)
Given a color return a list of shades from lightest to darkest by a step. By default the step is 10. White and black are excluded from the returned list.
Given a color return a list of shades from lightest to darkest by a step. By default the step is 10. White and black are excluded from the returned list.
(split-complement color)
(split-complement color distance-from-complement)
Given a color return a triple of the color and the two colors on either side of it's complement.
Given a color return a triple of the color and the two colors on either side of it's complement.
(tetrad color)
(tetrad color angle)
Given a color return a quadruple of four colors which are equidistance on the color wheel (ie. a pair of complements). An optional angle may be given for color of the second complement in the pair (this defaults to 90 when only color is passed).
Given a color return a quadruple of four colors which are equidistance on the color wheel (ie. a pair of complements). An optional angle may be given for color of the second complement in the pair (this defaults to 90 when only color is passed).
(transparentize color amount)
Decreases the alpha value of a given color by amount.
Decreases the alpha value of a given color by amount.
(triad color)
Given a color return a triple of colors which are equidistance apart on the color wheel.
Given a color return a triple of colors which are equidistance apart on the color wheel.
(weighted-mix color-1 color-2 weight)
weight
is number 0 to 100 (%).
At 0, it weighs color-1 at 100%.
At 100, it weighs color-2 at 100%.
Returns hex string.
`weight` is number 0 to 100 (%). At 0, it weighs color-1 at 100%. At 100, it weighs color-2 at 100%. Returns hex string.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close