Options
All
  • Public
  • Public/Protected
  • All
Menu

Module color

Index

Type aliases

Color

Color: [number, number, number]

Functions

add

add_

  • Add two or more colors, MODIFIES FIRST ARGUMENT

    Parameters

    Returns Color

fromString

  • fromString(str: string): Color

hsl2rgb

  • Converts an HSL color value to RGB. Expects 0..1 inputs, produces 0..255 outputs.

    Parameters

    Returns Color

interpolate

  • Interpolate (blend) two colors with a given factor

    Parameters

    Returns Color

interpolateHSL

  • Interpolate (blend) two colors with a given factor in HSL mode

    Parameters

    Returns Color

Const lerp

Const lerpHSL

multiply

multiply_

  • Multiply (mix) two or more colors, MODIFIES FIRST ARGUMENT

    Parameters

    Returns Color

randomize

  • Create a new random color based on this one

    Parameters

    • color: Color
    • diff: number | Color

      Set of standard deviations

    Returns Color

rgb2hsl

  • Converts an RGB color value to HSL. Expects 0..255 inputs, produces 0..1 outputs.

    Parameters

    Returns Color

toHex

  • toHex(color: Color): string

toRGB

  • toRGB(color: Color): string

Generated using TypeDoc