Data.Colour.SRGB.Linear

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

Safe Haskell | Safe-Inferred
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

Instances details

AffineSpace Colour # |
Instance details Defined in Data.Colour.Internal Methods affineCombo :: Num a => [(a, Colour a)] -> Colour a -> Colour a #
ColourOps Colour # |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> Colour a -> Colour a # darken :: Num a => a -> Colour a -> Colour a #
Num a => Monoid (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods mempty :: Colour a # mappend :: Colour a -> Colour a -> Colour a # mconcat :: [Colour a] -> Colour a #
Num a => Semigroup (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods (<>) :: Colour a -> Colour a -> Colour a # sconcat :: NonEmpty (Colour a) -> Colour a # stimes :: Integral b => b -> Colour a -> Colour a #
(Fractional a, Read a) => Read (Colour a) # |
Instance details Defined in Data.Colour Methods readsPrec :: Int -> ReadS (Colour a) # readList :: ReadS [Colour a] # readPrec :: ReadPrec (Colour a) # readListPrec :: ReadPrec [Colour a] #
(Fractional a, Show a) => Show (Colour a) # |
Instance details Defined in Data.Colour Methods showsPrec :: Int -> Colour a -> ShowS # show :: Colour a -> String # showList :: [Colour a] -> ShowS #
Eq a => Eq (Colour a) # |
Instance details Defined in Data.Colour.Internal Methods (==) :: Colour a -> Colour a -> Bool # (/=) :: Colour a -> Colour a -> Bool #

data RGB a #

An RGB triple for an unspecified colour space.

Constructors

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

#### Instances

Instances details

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

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.