colour-2.3.1: A model for human colour/color perceptionSource codeContentsIndex
Data.Colour.SRGB
Description
Specifies Colours in accordance with the sRGB standard.
Synopsis
data Colour a
data RGB a = RGB {
channelRed :: !a
channelGreen :: !a
channelBlue :: !a
}
sRGB24 :: (Ord b, Floating b) => Word8 -> Word8 -> Word8 -> Colour b
sRGBBounded :: (Ord b, Floating b, Integral a, Bounded a) => a -> a -> a -> Colour b
sRGB :: (Ord b, Floating b) => b -> b -> b -> Colour b
toSRGB24 :: (RealFrac b, Floating b) => Colour b -> RGB Word8
toSRGBBounded :: (RealFrac b, Floating b, Integral a, Bounded a) => Colour b -> RGB a
toSRGB :: (Ord b, Floating b) => Colour b -> RGB b
sRGB24shows :: (RealFrac b, Floating b) => Colour b -> ShowS
sRGB24show :: (RealFrac b, Floating b) => Colour b -> String
sRGB24reads :: (Ord b, Floating b) => ReadS (Colour b)
sRGB24read :: (Ord b, Floating b) => String -> Colour b
sRGBSpace :: (Ord a, Floating a) => RGBSpace a
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.

data RGB a Source
An RGB triple for an unspecified colour space.
Constructors
RGB
channelRed :: !a
channelGreen :: !a
channelBlue :: !a
sRGB24 :: (Ord b, Floating b) => Word8 -> Word8 -> Word8 -> Colour bSource
Construct a colour from a 24-bit (three 8-bit words) sRGB specification.
sRGBBounded :: (Ord b, Floating b, Integral a, Bounded a) => a -> a -> a -> Colour bSource
Construct a colour from an sRGB specification. Input components are expected to be in the range [0..maxBound].
sRGB :: (Ord b, Floating b) => b -> b -> b -> Colour bSource
Construct a colour from an sRGB specification. Input components are expected to be in the range [0..1].
toSRGB24 :: (RealFrac b, Floating b) => Colour b -> RGB Word8Source
Return the approximate 24-bit sRGB colour components as three 8-bit components. Out of range values are clamped.
toSRGBBounded :: (RealFrac b, Floating b, Integral a, Bounded a) => Colour b -> RGB aSource
Return the approximate sRGB colour components in the range [0..maxBound]. Out of range values are clamped.
toSRGB :: (Ord b, Floating b) => Colour b -> RGB bSource
Return the sRGB colour components in the range [0..1].
sRGB24shows :: (RealFrac b, Floating b) => Colour b -> ShowSSource
Show a colour in hexadecimal form, e.g. "#00aaff"
sRGB24show :: (RealFrac b, Floating b) => Colour b -> StringSource
Show a colour in hexadecimal form, e.g. "#00aaff"
sRGB24reads :: (Ord b, Floating b) => ReadS (Colour b)Source
Read a colour in hexadecimal form, e.g. "#00aaff" or "00aaff"
sRGB24read :: (Ord b, Floating b) => String -> Colour bSource
Read a colour in hexadecimal form, e.g. "#00aaff" or "00aaff"
sRGBSpace :: (Ord a, Floating a) => RGBSpace aSource
The sRGB colour space
Produced by Haddock version 2.6.1