Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Exports a representation of a colour as primary components.
Synopsis
- data RGB primaryColour
- black :: Num n => RGB n
- white24Bit :: (Integral n, Show n) => RGB n
- radix :: Integral i => i
- absDifference :: Num n => RGB n -> RGB n -> RGB n
- toTriple :: RGB a -> (a, a, a)
- mkRGB :: a -> a -> a -> RGB a
- mkRGB24Bit :: (Integral a, Show a) => a -> a -> a -> RGB a
- fromIntegral' :: (Integral i, Show i) => i -> RGB i
- (>+<) :: Num n => RGB n -> RGB n -> RGB n
- toRGBUnitInterval :: (Integral i, Fractional f) => RGB i -> RGB f
- fromRGBUnitInterval :: (Integral i, RealFrac f) => RGB f -> RGB i
Types
Data-types
data RGB primaryColour Source #
The representation of a colour as three primary components.
Constants
radix :: Integral i => i Source #
Constant base of number-system used to represent 24-bit colours in HTML.
Functions
absDifference :: Num n => RGB n -> RGB n -> RGB n Source #
Find the absolute difference between the matching component colours.
Constructors
fromIntegral' :: (Integral i, Show i) => i -> RGB i Source #
Represents the specified positive integral value as RGB 24-bit.
Operators
(>+<) :: Num n => RGB n -> RGB n -> RGB n infixl 6 Source #
- Add the matching component colours.
- CAVEAT: this may result in overflow.
Translation
toRGBUnitInterval :: (Integral i, Fractional f) => RGB i -> RGB f Source #
Convert RGB 24-bit to RGB UnitInterval, i.e. map from the closed interval [0,255] to the semi-closed interval [0,1).