HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulecolour-2.3.7Haskell98

Data.Colour.Ok

Functions for converting Colour values to and from the Oklab space, and convenience functions for the derived Oklch space. See https://bottosson.github.io/posts/oklab/.

  • 4 values
  • Packagecolour-2.3.7
  • Exports4
  • LanguageHaskell98
  • LicenceMIT
  • SourceOk.hs
valueokLab
  1. :: Floating a
  2. => a

    L* coordinate (lightness)

  3. -> a

    a* coordinate

  4. -> a

    b* coordinate

  5. -> Colour a
#

Returns the colour for given Oklab coordinates, which is a perceptually uniform colour space inspired by CIELAB but which handles blue hues more accurately.

A white point is not specified because Oklab assumes a standard d65 daylight illuminant.

valueokLabView :: Floating a => Colour a -> (a, a, a)
#

Returns the Oklab coordinates of a colour, which is a perceptually uniform colour space inspired by CIELAB but which handles blue hues more accurately.

A white point is not specified because Oklab assumes a standard d65 daylight illuminant.

valueokLCh
  1. :: Floating a
  2. => a

    L* coordinate (lightness)

  3. -> a

    C* coordinate (chroma)

  4. -> a

    h* coordinate (hue)

  5. -> Colour a
#

Constructs a colour from a lightness, chroma, and hue given in LCh polar coordinates correspondong to an Oklab coordinate.

valueokLChView :: RealFloat a => Colour a -> (a, a, a)
#

Returns the Oklab LCh coordinates of a colour. The lightness coordinate is the same as in Oklab, while the chroma C and hue h are the (a,b)-coordinates expressed in polar form.