Liking cljdoc? Tell your friends :D

garden.color

Utilities for color creation, conversion, and manipulation.

Utilities for color creation, conversion, and manipulation.
raw docstring

analogousclj/s

(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.
sourceraw docstring

as-colorclj/s

source

as-hexclj/s

(as-hex x)

Convert a color to a hexadecimal string.

Convert a color to a hexadecimal string.
sourceraw docstring

as-hslclj/s

(as-hsl x)

Convert a color to a HSL.

Convert a color to a HSL.
sourceraw docstring

as-hslaclj/s

(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.
sourceraw docstring

as-rgbclj/s

(as-rgb x)

Convert a color to a RGB.

Convert a color to a RGB.
sourceraw docstring

color*clj/s

(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.
sourceraw docstring

color+clj/s

(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.
sourceraw docstring

color-clj/s

(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.
sourceraw docstring

color-divclj/s

(color-div a)
(color-div a b)
(color-div a b & more)

Multiply the RGB components of two or more colors.

Multiply the RGB components of two or more colors.
sourceraw docstring

color-name->hexclj/s

source

color?clj/s

(color? x)

Return true if x is a color.

Return true if x is a color.
sourceraw docstring

complementclj/s

(complement color)

Return the complement of a color.

Return the complement of a color.
sourceraw docstring

CSSColorcljs

source

darkenclj/s

(darken color amount)

Decrease the lightness value a given color by amount.

Decrease the lightness value a given color by amount.
sourceraw docstring

desaturateclj/s

(desaturate color amount)

Decrease the saturation value of a given color by amount.

Decrease the saturation value of a given color by amount.
sourceraw docstring

from-nameclj/s

(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.
sourceraw docstring

hex->hslclj/s

(hex->hsl color)

Convert a hexadecimal color to an HSL color.

Convert a hexadecimal color to an HSL color.
sourceraw docstring

hex->rgbclj/s

(hex->rgb s)

Convert a hexadecimal color to an RGB color map.

Convert a hexadecimal color to an RGB color map.
sourceraw docstring

hex-reclj/s

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.
sourceraw docstring

hex?clj/s

(hex? x)

Returns true if x is a hexadecimal color.

Returns true if x is a hexadecimal color.
sourceraw docstring

hslclj/s

(hsl [h s l])
(hsl h s l)

Create an HSL color.

Create an HSL color.
sourceraw docstring

hsl->hexclj/s

(hsl->hex color)

Convert an HSL color map to a hexadecimal string.

Convert an HSL color map to a hexadecimal string.
sourceraw docstring

hsl->rgbclj/s

(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.
sourceraw docstring

hsl?clj/s

(hsl? color)

Return true if color is an HSL color.

Return true if color is an HSL color.
sourceraw docstring

hslaclj/s

(hsla [h s l a])
(hsla h s l a)

Create an HSLA color.

Create an HSLA color.
sourceraw docstring

hsla?clj/s

(hsla? color)

Return true if color is an HSLA color.

Return true if color is an HSLA color.
sourceraw docstring

invertclj/s

(invert color)

Return the inversion of a color.

Return the inversion of a color.
sourceraw docstring

lightenclj/s

(lighten color amount)

Increase the lightness value a given color by amount.

Increase the lightness value a given color by amount.
sourceraw docstring

mixclj/s

(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.
sourceraw docstring

opacifyclj/s

(opacify color amount)

Increases the alpha value of a given color by amount.

Increases the alpha value of a given color by amount.
sourceraw docstring

percent-clipclj/s

source

rgbclj/s

(rgb [r g b :as vs])
(rgb r g b)

Create an RGB color.

Create an RGB color.
sourceraw docstring

rgb->hexclj/s

(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.
sourceraw docstring

rgb->hslclj/s

(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.
sourceraw docstring

rgb-clipclj/s

source

rgb?clj/s

(rgb? color)

Return true if color is an RGB color.

Return true if color is an RGB color.
sourceraw docstring

rgbaclj/s

(rgba [r g b a])
(rgba r g b a)

Create an RGBA color.

Create an RGBA color.
sourceraw docstring

rotate-hueclj/s

(rotate-hue color amount)

Rotates the hue value of a given color by amount.

Rotates the hue value of a given color by amount.
sourceraw docstring

saturateclj/s

(saturate color amount)

Increase the saturation value of a given color by amount.

Increase the saturation value of a given color by amount.
sourceraw docstring

scale-alphaclj/s

(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.
sourceraw docstring

scale-lightnessclj/s

(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.
sourceraw docstring

scale-saturationclj/s

(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.
sourceraw docstring

shadesclj/s

(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.
sourceraw docstring

split-complementclj/s

(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.
sourceraw docstring

tetradclj/s

(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).
sourceraw docstring

transparentizeclj/s

(transparentize color amount)

Decreases the alpha value of a given color by amount.

Decreases the alpha value of a given color by amount.
sourceraw docstring

triadclj/s

(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.
sourceraw docstring

trim-oneclj/s

(trim-one x)
source

weighted-mixclj/s

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close