colour-2.3.3: A model for human colour/color perception

Safe Haskell | Safe-Inferred

Data.Colour.RGBSpace.HSL

Synopsis

- data RGB a
- hslView :: (Fractional a, Ord a) => RGB a -> (a, a, a)
- hue :: (Fractional a, Ord a) => RGB a -> a
- saturation :: (Fractional a, Ord a) => RGB a -> a
- lightness :: (Fractional a, Ord a) => RGB a -> a
- hsl :: (RealFrac a, Ord a) => a -> a -> a -> RGB a

# Documentation

data RGB a Source

An RGB triple for an unspecified colour space.

Instances

Functor RGB |
Applicative RGB |
Eq a => Eq (RGB a) |
Read a => Read (RGB a) |
Show a => Show (RGB a) |

hslView :: (Fractional a, Ord a) => RGB a -> (a, a, a)Source

Returns the HSL (hue-saturation-lightness) coordinates of an `RGB` triple. See `hue`, `saturation`, and `lightness`.

hue :: (Fractional a, Ord a) => RGB a -> aSource

The `hue` coordinate of an `RGB` value is in degrees. Its value is always in the range 0-360.

saturation :: (Fractional a, Ord a) => RGB a -> aSource

Returns the saturation coordinate of an `RGB` triple for the HSL (hue-saturation-lightness) system. Note: This is different from `saturation` for the Data.Colour.RGBSpace.HSV

lightness :: (Fractional a, Ord a) => RGB a -> aSource

Returns the lightness coordinate of an `RGB` triple for the HSL (hue-saturation-lightness) system.

hsl :: (RealFrac a, Ord a) => a -> a -> a -> RGB aSource

Convert HSL (hue-saturation-lightness) coordinates to an `RGB` value. Hue is expected to be measured in degrees.