Copyright | (c) 2010 Simon Meier |
---|---|
License | GPL v3 (see LICENSE) |
Maintainer | Simon Meier <iridcode@gmail.com> |
Safe Haskell | Safe |
Language | Haskell98 |
Data.Color
Description
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 :: Fractional t => RGB t
- green :: Fractional t => RGB t
- blue :: 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] #
Hexadecimal representation of an HSV value; i.e., of its corresponding RGB value.
Predefined colors
red :: Fractional t => RGB t #
green :: Fractional t => RGB t #
blue :: Fractional t => RGB t #
Conversions
rgbToHSV :: (Fractional t, Ord t) => RGB t -> HSV t #
RGB to HSV conversion. Pre: 0 <= r,g,b <= 1 (Source: http://de.wikipedia.org/wiki/HSV-Farbraum)
hsvToRGB :: RealFrac t => HSV t -> RGB t #
HSV to RGB conversion. Pre: 0 <= h <= 360 and 0 <= s,v <= 1 (Source: http://de.wikipedia.org/wiki/HSV-Farbraum)