Data.Colour.SRGB.Linear

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

Safe Haskell | Safe
Language | Haskell98

Data.Colour.SRGB.Linear

Description

Provides a linear colour space with the same gamut as Data.Colour.SRGB.

Synopsis

- data Colour a
- data RGB a = RGB {
  - channelRed :: !a
  - channelGreen :: !a
  - channelBlue :: !a
  }
- rgb :: Fractional a => a -> a -> a -> Colour a
- toRGB :: Fractional a => Colour a -> RGB a
- sRGBGamut :: RGBGamut

# Documentation

data Colour a #

This type represents the human preception of colour. The `a` parameter is a numeric type used internally for the representation.

The `Monoid` instance allows one to add colours, but beware that adding colours can take you out of gamut. Consider using `blend` whenever possible.

Instances

ColourOps Colour # |
Methods over :: Num a => AlphaColour a -> Colour a -> Colour a # darken :: Num a => a -> Colour a -> Colour a #
AffineSpace Colour # |
Methods affineCombo :: Num a => [(a, Colour a)] -> Colour a -> Colour a #
Eq a => Eq (Colour a) # |
Methods (==) :: Colour a -> Colour a -> Bool # (/=) :: Colour a -> Colour a -> Bool #
Num a => Monoid (Colour a) # |
Methods mempty :: Colour a # mappend :: Colour a -> Colour a -> Colour a # mconcat :: [Colour a] -> Colour a #

data RGB a #

An RGB triple for an unspecified colour space.

Constructors

RGB |
Fields channelRed :: !a channelGreen :: !a channelBlue :: !a

Instances

Functor RGB # |
Methods fmap :: (a -> b) -> RGB a -> RGB b # (<$) :: a -> RGB b -> RGB a #
Applicative RGB # |
Methods pure :: a -> RGB a # (<*>) :: RGB (a -> b) -> RGB a -> RGB b # (*>) :: RGB a -> RGB b -> RGB b # (<*) :: RGB a -> RGB b -> RGB a #
Eq a => Eq (RGB a) # |
Methods (==) :: RGB a -> RGB a -> Bool # (/=) :: RGB a -> RGB a -> Bool #
Read a => Read (RGB a) # |
Methods readsPrec :: Int -> ReadS (RGB a) # readList :: ReadS [RGB a] # readPrec :: ReadPrec (RGB a) # readListPrec :: ReadPrec [RGB a] #
Show a => Show (RGB a) # |
Methods showsPrec :: Int -> RGB a -> ShowS # show :: RGB a -> String # showList :: [RGB a] -> ShowS #

rgb :: Fractional a => a -> a -> a -> Colour a #

Constructs a `Colour` from RGB values using the linear RGB colour with the same gamut as sRGB.

toRGB :: Fractional a => Colour a -> RGB a #

Return RGB values using the linear RGB colour with the same gamut as sRGB.

sRGBGamut :: RGBGamut #

This is the gamut for the sRGB colour space.