Function toHsl

Parses colour to { h, s, l }, each field being on 0..1 scale.

Note that some colours will return NaN for h,s or l. This is because they have indeterminate hue. For example white, black and transparent. Use 'safe = true' to ensure a safe colour is returned.

  • Parameters

    • colour: Colourish
    • safe: boolean = false

      When true, returned colour will not include NaN. Default: false

    Returns Hsl