Interface LCHColorFactory

An LCH (CIELCH) color factory function to create an HCL color object.

interface LCHColorFactory {
    (l, c, h, opacity?): HCLColor;
    (cssColorSpecifier): HCLColor;
    (color): HCLColor;
}
  • Constructs a new HCL color based on the specified channel values and opacity.

    Parameters

    • l: number

      Luminance channel value typically in the range [0, 100].

    • c: number

      Chroma channel value typically in [0, 230].

    • h: number

      Hue channel value typically in [0, 360).

    • Optional opacity: number

      Optional opacity value, defaults to 1.

    Returns HCLColor

  • Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color. If the specifier was not valid, null is returned.

    Parameters

    • cssColorSpecifier: string

      A CSS color Module Level 3 specifier string.

    Returns HCLColor

  • Converts the provided color instance and returns an HCL color. The color instance is converted to the RGB color space using color.rgb and then converted to HCL. (Colors already in the HCL color space skip the conversion to RGB, and colors in the Lab color space are converted directly to HCL.)

    Parameters

    Returns HCLColor