Copyright | (C) 2013 Parnell Springmeyer |
---|---|
License | BSD3 |
Maintainer | Parnell Springmeyer <parnell@digitalmentat.com> |
Stability | stable |
Safe Haskell | None |
Language | Haskell2010 |
- newtype RGBtoXYZ = RGBtoXYZ [[Double]]
- newtype XYZtoRGB = XYZtoRGB [[Double]]
- type Hex = String
- type Percent = Integer
- data RGB = RGB !Word8 !Word8 !Word8
- data CIEXYZ = CIEXYZ !Double !Double !Double
- data CIELAB = CIELAB !Double !Double !Double
- data CIELCH = CIELCH !Double !Double !Double
- class PresetColor c where
- class BlendableColor c where
- class AdjustableColor c where
- shortestPath :: Double -> Double
- pct :: Percent -> Double
- pctClamp :: Percent -> Percent
Documentation
Working space matrix to convert from sRGB to CIE XYZ.
Working space matrix to convert from CIE XYZ to sRGB.
A color in the sRGB color space.
A color in the CIE XYZ color space.
A color in the CIE L*a*b*
color space.
A color in the CIE L*C*h(uv)
color space.
class PresetColor c where Source #
Preset white and black for a color space.
class BlendableColor c where Source #
A blendable color.
interpolate :: Percent -> (c, c) -> c Source #
Interpolate a color with another color, applying a weight.
Blend two Blendable
colors using an interpolation weight of
50%.
shade :: PresetColor c => c -> Percent -> c Source #
Shade a color by blending it using a weight and the
PresetColor
black.
tint :: PresetColor c => c -> Percent -> c Source #
Tint a color by blending it using a weight and the
PresetColor
white.
class AdjustableColor c where Source #
An adjustable color.
lightness :: c -> Percent -> c Source #
Adjust the lightness of a color
chroma :: c -> Percent -> c Source #
Adjust the chroma of a color
NB: not all color spaces will support this easily but it should be possible to convert into a color space that does then convert back
hue :: c -> Percent -> c Source #
Adjust the hue of a color
shortestPath :: Double -> Double Source #
Give the shortest path to the hue value.