Copyright | (c) Daniel Winograd-Cort 2015 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | dwc@cs.yale.edu |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
- data Color
- = Black
- | Blue
- | Green
- | Cyan
- | Red
- | Magenta
- | Yellow
- | White
- | Gray
- | VLightBeige
- | LightBeige
- | MediumBeige
- | DarkBeige
- data RGB
- colorToRGB :: Color -> RGB
- rgb :: (Integral r, Integral g, Integral b) => r -> g -> b -> Maybe RGB
- rgbE :: (Integral r, Integral g, Integral b, Show r, Show g, Show b) => r -> g -> b -> RGB
- extractRGB :: (Integral r, Integral g, Integral b) => RGB -> (r, g, b)
Documentation
We provide a data type for colors to allow users to easily and clearly specify common colors. Primary and secondary RGB colors are represented along with a few beige colors for use in many GUI elements.
Black | |
Blue | |
Green | |
Cyan | |
Red | |
Magenta | |
Yellow | |
White | |
Gray | |
VLightBeige | |
LightBeige | This is the default background color for the UI window. |
MediumBeige | |
DarkBeige |
colorToRGB :: Color -> RGB Source
Generally used as an internal function for converting Color to RGB, but can be used by anyone.
rgb :: (Integral r, Integral g, Integral b) => r -> g -> b -> Maybe RGB Source
This function takes three integral values between 0 and 255 inclusive and create an RGB value with them. If any of the values fall outside the acceptable range, Nothing is returned.