Maintainer | Simon Meier <iridcode@gmail.com> |
---|---|
Safe Haskell | Safe-Infered |
A simple color module for handling RGB and HSV representations of colors.
- data RGB a = RGB {}
- data HSV a = HSV {}
- rgbToHex :: RealFrac t => RGB t -> String
- hsvToHex :: RealFrac t => HSV t -> [Char]
- red, blue, green :: Fractional t => RGB t
- rgbToGray :: Ord t => RGB t -> t
- hsvToGray :: Num t => HSV t -> HSV t
- rgbToHSV :: (Fractional t, Ord t) => RGB t -> HSV t
- hsvToRGB :: RealFrac t => HSV t -> RGB t
- colorGroups :: Double -> [Int] -> [((Int, Int), HSV Double)]
- lightColorGroups :: Double -> [Int] -> [((Int, Int), HSV Double)]
Datatypes
hsvToHex :: RealFrac t => HSV t -> [Char]Source
Hexadecimal representation of an HSV value; i.e., of its corresponding RGB value.
Predefined colors
Conversions
rgbToHSV :: (Fractional t, Ord t) => RGB t -> HSV tSource
RGB to HSV conversion. Pre: 0 <= r,g,b <= 1 (Source: http:de.wikipedia.orgwikiHSV-Farbraum)
hsvToRGB :: RealFrac t => HSV t -> RGB tSource
HSV to RGB conversion. Pre: 0 <= h <= 360 and 0 <= s,v <= 1 (Source: http:de.wikipedia.orgwikiHSV-Farbraum)