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 Source #

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

data RGB a Source #

An RGB triple for an unspecified colour space.

Constructors

RGB |

Fields

- channelRed :: !a
- channelGreen :: !a
- channelBlue :: !a

#### Instances

Instances details

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

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

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

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

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

sRGBGamut :: RGBGamut Source #

This is the gamut for the sRGB colour space.