Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "hsluv"

Index

Variables

Const epsilon

epsilon: number = 0.0088564516

Const hexChars

hexChars: String = "0123456789abcdef"

Const kappa

kappa: number = 903.2962962

Const m

m: number[][] = [[ 3.240969941904521, -1.537383177570093, -0.498610760293 ],[ -0.96924363628087, 1.87596750150772, 0.041555057407175 ],[ 0.055630079696993, -0.20397695888897, 1.056971514242878 ]]

Const minv

minv: number[][] = [[ 0.41239079926595, 0.35758433938387, 0.18048078840183 ],[ 0.21263900587151, 0.71516867876775, 0.072192315360733 ],[ 0.019330818715591, 0.11919477979462, 0.95053215224966 ]]

Const refU

refU: number = 0.19783000664283

Const refV

refV: number = 0.46831999493879

Const refY

refY: number = 1

Functions

Const dot_product

  • dot_product(a: number[], b: number[]): number
  • Parameters

    • a: number[]
    • b: number[]

    Returns number

Const from_linear

  • from_linear(c: number): number
  • Parameters

    • c: number

    Returns number

Const get_bounds

  • get_bounds(L: number): line[]
  • For a given lightness, return a list of 6 lines in slope-intercept form that represent the bounds in CIELUV, stepping over which will push a value out of the RGB gamut

    Parameters

    • L: number

    Returns line[]

Const hex_to_hpluv

  • hex_to_hpluv(s: string): hpl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • s: string

    Returns hpl

    An array containing the color's HSL values in HPLuv (pastel variant) color space.

Const hex_to_hsluv

  • hex_to_hsluv(s: string): hsl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • s: string

    Returns hsl

    An array containing the color's HSL values in HSLuv color space.

Const hex_to_rgb

  • hex_to_rgb(uhex: string): rgb
  • RGB values are ranging in [0;1].

    Parameters

    • uhex: string

    Returns rgb

    An array containing the color's RGB values.

Const hpluv_to_hex

  • hpluv_to_hex(tuple: hpl): string

Const hpluv_to_lch

  • hpluv_to_lch(tuple: hpl): lch
  • HSLuv values are in [0;360], [0;100] and [0;100].

    Parameters

    • tuple: hpl

      An array containing the color's H,S,L values in HPLuv (pastel variant) color space.

    Returns lch

    An array containing the resulting color's LCH coordinates.

Const hpluv_to_rgb

  • hpluv_to_rgb(tuple: hpl): rgb
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • tuple: hpl

      An array containing the color's HSL values in HPLuv (pastel variant) color space.

    Returns rgb

    An array containing the resulting color's RGB coordinates.

Const hsluv_to_hex

  • hsluv_to_hex(tuple: hsl): string
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • tuple: hsl

      An array containing the color's HSL values in HSLuv color space.

    Returns string

    A string containing a #RRGGBB representation of given color.

Const hsluv_to_lch

  • hsluv_to_lch(tuple: hsl): lch
  • HSLuv values are ranging in [0;360], [0;100] and [0;100].

    Parameters

    • tuple: hsl

      An array containing the color's H,S,L values in HSLuv color space.

    Returns lch

    An array containing the resulting color's LCH coordinates.

Const hsluv_to_rgb

  • hsluv_to_rgb(tuple: hsl): rgb
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • tuple: hsl

      An array containing the color's HSL values in HSLuv color space.

    Returns rgb

    An array containing the resulting color's RGB coordinates.

Const l_to_y

  • l_to_y(L: number): number
  • Parameters

    • L: number

    Returns number

Const lch_to_hpluv

  • lch_to_hpluv(tuple: lch): hpl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100].

    Parameters

    • tuple: lch

      An array containing the color's LCH values.

    Returns hpl

    An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space.

Const lch_to_hsluv

  • lch_to_hsluv(tuple: lch): hsl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100].

    Parameters

    • tuple: lch

      An array containing the color's LCH values.

    Returns hsl

    An array containing the resulting color's HSL coordinates in HSLuv color space.

Const lch_to_luv

  • Parameters

    • tuple: lch

      An array containing the color's L,C,H values.

    Returns luv

    An array containing the resulting color's LUV coordinates.

Const lch_to_rgb

  • RGB values are ranging in [0;1].

    Parameters

    • tuple: lch

      An array containing the color's LCH values.

    Returns rgb

    An array containing the resulting color's RGB coordinates.

Const luv_to_lch

  • Parameters

    • tuple: luv

      An array containing the color's L,U,V values.

    Returns lch

    An array containing the resulting color's LCH coordinates.

Const luv_to_xyz

  • XYZ coordinates are ranging in [0;1].

    Parameters

    • tuple: luv

      An array containing the color's L,U,V values.

    Returns xyz

    An array containing the resulting color's XYZ coordinates.

Const max_chroma_for_lh

  • max_chroma_for_lh(L: number, H: number): number
  • Parameters

    • L: number
    • H: number

    Returns number

Const max_safe_chroma_for_l

  • max_safe_chroma_for_l(L: number): number
  • For given lightness, returns the maximum chroma. Keeping the chroma value below this number will ensure that for any hue, the color is within the RGB gamut.

    Parameters

    • L: number

    Returns number

Const rgb_to_hex

  • rgb_to_hex(tuple: rgb): string
  • RGB values are ranging in [0;1].

    Parameters

    • tuple: rgb

      An array containing the color's RGB values.

    Returns string

    A string containing a #RRGGBB representation of given color.

Const rgb_to_hpluv

  • rgb_to_hpluv(tuple: rgb): hpl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • tuple: rgb

      An array containing the color's RGB coordinates.

    Returns hpl

    An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space.

Const rgb_to_hsluv

  • rgb_to_hsluv(tuple: rgb): hsl
  • HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].

    Parameters

    • tuple: rgb

      An array containing the color's RGB coordinates.

    Returns hsl

    An array containing the resulting color's HSL coordinates in HSLuv color space.

Const rgb_to_lch

  • RGB values are ranging in [0;1].

    Parameters

    • tuple: rgb

      An array containing the color's RGB values.

    Returns lch

    An array containing the resulting color's LCH coordinates.

Const rgb_to_xyz

  • RGB coordinates are ranging in [0;1] and XYZ coordinates in [0;1].

    Parameters

    • tuple: rgb

      An array containing the color's R,G,B values.

    Returns xyz

    An array containing the resulting color's XYZ coordinates.

Const to_linear

  • to_linear(c: number): number
  • Parameters

    • c: number

    Returns number

Const xyz_to_luv

  • XYZ coordinates are ranging in [0;1].

    Parameters

    • tuple: xyz

      An array containing the color's X,Y,Z values.

    Returns luv

    An array containing the resulting color's LUV coordinates.

Const xyz_to_rgb

  • XYZ coordinates are ranging in [0;1] and RGB coordinates in [0;1] range.

    Parameters

    • tuple: xyz

      An array containing the color's X,Y and Z values.

    Returns rgb

    An array containing the resulting color's red, green and blue.

Const y_to_l

  • y_to_l(Y: number): number
  • In these formulas, Yn refers to the reference white point. We are using illuminant D65, so Yn (see refY in Maxima file) equals 1. The formula is simplified accordingly.

    Parameters

    • Y: number

    Returns number

Generated using TypeDoc