Like convert, but result is a CSS colour string
Creates discrete colour steps between two colours.
Returns a CSS linear-gradient
with stops corresponding to the given list of colours
.
Converts from some kind of colour that is legal in CSS into a structured Colour type.
Returns a full HSL colour string (eg hsl(20,50%,75%)
) based on a index.
It's useful for generating perceptually different shades as the index increments.
Returns a function that interpolates between two colours. Returns string colour values.
Multiplies the opacity of a colour by amount
, returning a computed CSS colour.
Returns a random hue component (0..359)
Resolves a named colour or CSS variable to a colour string. Doesn't do conversion or parsing.
Produces a stepped scale of colours.
Returns a CSS-ready string representation.
If the input object has r,g&b properties, it will return a fully-
formed Rgb type with unit
and space
properties.
Does a computation with the opacity of a colour, returning colour.
Options for interpolation
A representation of colour. Eg: blue
, rgb(255,0,0)
, hsl(20,100%,50%)
HSL value. By default assumes scalar coordinates (0..1) for each field. Use 'absolute' unit for hue:0...360, all other fields on 0..100 scale.
Absolute values use hue:0..360, all other fields 0..100
Scalar values use 0..1 for each field
Oklch colour expressed with: l: 0..1 c: 0..4 h: 0..360 degrees opacity: 0..1
Oklch colour expressed in 0..1 scalar values for LCH & opacity
Rgb. Units determine how to interperet rgb values.
RGB in 0...255 range, including opacity.
Rgb. Units determine how to interperet rgb values.
Converts an object or string representation of colour to ixfx's structured colour. Use convertToString if you want a CSS colour string instead.