ixfx
    Preparing search index...

    Namespace Colour

    Namespaces

    HslSpace
    OklchSpace
    SrgbSpace

    Functions

    convert

    Converts an object or string representation of colour to ixfx's structured colour. Use convertToString if you want a CSS colour string instead.

    convertScalar
    convertToString

    Like convert, but result is a CSS colour string

    createSteps

    Creates discrete colour steps between two colours.

    cssLinearGradient

    Returns a CSS linear-gradient with stops corresponding to the given list of colours.

    fromCssColour

    Converts from some kind of colour that is legal in CSS into a structured Colour type.

    goldenAngleColour

    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.

    guard
    interpolator

    Returns a function that interpolates between two colours. Returns string colour values.

    isColourish
    isHsl
    isOkLch
    isRgb
    multiplyOpacity

    Multiplies the opacity of a colour by amount, returning a computed CSS colour.

    randomHue

    Returns a random hue component (0..359)

    resolveCss

    Resolves a named colour or CSS variable to a colour string. Doesn't do conversion or parsing.

    rgbToHsl
    scale

    Produces a stepped scale of colours.

    setOpacity
    toColour
    toCssColour
    toLibraryColour
    toStringFirst

    Returns a CSS-ready string representation.

    tryParseObjectToHsl
    tryParseObjectToRgb

    If the input object has r,g&b properties, it will return a fully- formed Rgb type with unit and space properties.

    withOpacity

    Does a computation with the opacity of a colour, returning colour.

    Type Aliases

    Colour
    ColourInterpolationOpts

    Options for interpolation

    ColourInterpolator
    Colourish

    A representation of colour. Eg: blue, rgb(255,0,0), hsl(20,100%,50%)

    ColourSpaces
    ColourStepOpts
    ConvertDestinations
    CreateStepsOptions
    Hsl

    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.

    HslAbsolute

    Absolute values use hue:0..360, all other fields 0..100

    HslBase
    HslScalar

    Scalar values use 0..1 for each field

    LchBase
    OkLch
    OkLchAbsolute

    Oklch colour expressed with: l: 0..1 c: 0..4 h: 0..360 degrees opacity: 0..1

    OkLchBase
    OkLchScalar

    Oklch colour expressed in 0..1 scalar values for LCH & opacity

    ParsingOptions
    Rgb

    Rgb. Units determine how to interperet rgb values.

    • 'scalar': 0..1 range for RGB & opacity
    • '8bit': 0..255 range for RGB & opacity
    Rgb8Bit

    RGB in 0...255 range, including opacity.

    RgbBase

    Rgb. Units determine how to interperet rgb values.

    • 'scalar': 0..1 range for RGB & opacity
    • '8bit': 0..255 range for RGB & opacity
    RgbScalar

    Variables

    cssDefinedHexColours