Manipulate colors with 'chroma.js' library. See https://gka.github.io/chroma.js/.
new()Create a new chroma instance.
chroma$new(color = NULL)
colorName, hex code or a vector of length 3 (rgb) of a color.
A new 'chroma' object.
chroma.hsl()Create a new chroma instance with HSL color.
chroma$chroma.hsl(hue, saturation, lightness)
hueHue parameter.
saturationAaturation parameter.
lightnessLightness parameter.
A new 'chroma' object.
chroma.hsv()Create a new chroma instance with HSV color.
chroma$chroma.hsv(hue, saturation, value)
hueHue parameter.
saturationSaturation parameter.
valueValue parameter.
A new 'chroma' object.
chroma.lch()Create a new chroma instance with LCH color.
chroma$chroma.lch(Lightness, chroma, hue)
LightnessLightness parameter.
chromaChroma parameter.
hueHue parameter.
A new 'chroma' object.
chroma.gl()Create a new chroma instance with RGB color.
chroma$chroma.gl(red, green, blue, alpha = NULL)
redRed parameter.
greenGreen parameter.
blueBlue parameter.
alphaAlpha parameter.
A new 'chroma' object.
mix()Mixes two colors
chroma$mix(color2, ratio = 0.5, mode = c("rgb", "hsl", "lab", "lrgb", "lch"))color2Name of a second color.
ratioA value between 0 and 1.
modeColor space used for interpolation.
A 'chroma' object modified.
average()Average between colors
chroma$average(colors, mode = c("rgb", "hsl", "lab", "lrgb", "lch"))colorsColor(s).
modeColor space used for interpolation.
A 'chroma' object modified.
blend()Blend two colors
chroma$blend(
color2,
type = c("multiply", "darken", "lighten", "screen", "overlay", "burn", "dodge")
)color2Name of a second color.
blendBlend mode.
A 'chroma' object modified.
random()Get a random color
chroma$random()
A 'chroma' object modified.
contrast()Contrast between two colors
chroma$contrast(color1, color2)
color1Name of first color.
color2Name of second color.
A 'chroma' object modified.
distance()Distance between two colors
chroma$distance(color1, color2, mode = c("lab", "rgb", "hsl", "lrgb", "lch"))color1Name of first color.
color2Name of second color.
A 'chroma' object modified.
alpha()chroma$alpha(value = NA)
brighten()chroma$brighten(value = 1)
darken()chroma$darken(value = 1)
saturate()chroma$saturate(value = 1)
desaturate()chroma$desaturate(value = 1)
set()chroma$set(channel, value)
get()chroma$get(channel)
luminance()chroma$luminance(lum = NULL, mode = "rgb")
hex()Return color as hexadecimal
chroma$hex()
A character.
name()Return color's name
chroma$name()
A character.
css()Return color as CSS code
chroma$css()
A character.
rgb()Return color as RGB
chroma$rgb(round = TRUE)
A character.
rgba()Return color as RGBA
chroma$rgba(round = TRUE)
A character.
hsl()Return color as HSL
chroma$hsl()
A character.
hsv()Return color as HSV
chroma$hsv()
A character.
hsi()Return color as HSI
chroma$hsi()
A character.
lab()Return color as LAB
chroma$lab()
A character.
lch()Return color as LCH
chroma$lch()
A character.
hcl()Return color as HCL
chroma$hcl()
A character.
gl()Return color as GL
chroma$gl()
A character.
print()Print chroma javascript code
chroma$print()
A character.
eval()Evaluate chroma call in javascript
chroma$eval(type_convert = TRUE, split_char = ",")
type_convertConvert data to appropriate type.
split_charCharacter used to split results.
The result of chroma instructions.
clone()The objects of this class are cloneable with this method.
chroma$clone(deep = FALSE)
deepWhether to make a deep clone.
Dont initialize chroma instance with a color.
Dont initialize chroma instance with a color.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.