colour
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Colour.Ok

Description

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/.

Synopsis

Documentation

okLab Source #

Arguments

:: Floating a 
=> a

L* coordinate (lightness)

-> a

a* coordinate

-> a

b* coordinate

-> 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.

okLabView :: Floating a => Colour a -> (a, a, a) Source #

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.

okLCh Source #

Arguments

:: Floating a 
=> a

L* coordinate (lightness)

-> a

C* coordinate (chroma)

-> a

h* coordinate (hue)

-> Colour a 

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

okLChView :: RealFloat a => Colour a -> (a, a, a) Source #

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.