prizm-1.0.5: Color transformations in different color spaces

Copyright(C) 2013 Parnell Springmeyer
LicenseBSD3
MaintainerParnell Springmeyer <parnell@digitalmentat.com>
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

Data.Prizm.Types

Description

 

Synopsis

Documentation

newtype RGBtoXYZ Source #

Working space matrix to convert from sRGB to CIE XYZ.

Constructors

RGBtoXYZ [[Double]] 

newtype XYZtoRGB Source #

Working space matrix to convert from CIE XYZ to sRGB.

Constructors

XYZtoRGB [[Double]] 

type Hex = String Source #

Hexadecimal encoded color code with an octothorpe prefix; e.g: #AB9D92.

type Percent = Integer Source #

A percent value ranging from -100 to 100; e.g: -82%, 80%, 10%.

data RGB Source #

A color in the sRGB color space.

Constructors

RGB !Word8 !Word8 !Word8 

Instances

Eq RGB Source # 

Methods

(==) :: RGB -> RGB -> Bool #

(/=) :: RGB -> RGB -> Bool #

Ord RGB Source # 

Methods

compare :: RGB -> RGB -> Ordering #

(<) :: RGB -> RGB -> Bool #

(<=) :: RGB -> RGB -> Bool #

(>) :: RGB -> RGB -> Bool #

(>=) :: RGB -> RGB -> Bool #

max :: RGB -> RGB -> RGB #

min :: RGB -> RGB -> RGB #

Show RGB Source # 

Methods

showsPrec :: Int -> RGB -> ShowS #

show :: RGB -> String #

showList :: [RGB] -> ShowS #

MonoFunctor RGB Source # 

Methods

omap :: (Element RGB -> Element RGB) -> RGB -> RGB #

type Element RGB Source # 

data CIEXYZ Source #

A color in the CIE XYZ color space.

Constructors

CIEXYZ !Double !Double !Double 

data CIELAB Source #

A color in the CIE L*a*b* color space.

Constructors

CIELAB !Double !Double !Double 

data CIELCH Source #

A color in the CIE L*C*h(uv) color space.

Constructors

CIELCH !Double !Double !Double 

class PresetColor c where Source #

Preset white and black for a color space.

Minimal complete definition

white, black

Methods

white :: c Source #

black :: c Source #

class BlendableColor c where Source #

A blendable color.

Minimal complete definition

interpolate

Methods

interpolate :: Percent -> (c, c) -> c Source #

Interpolate a color with another color, applying a weight.

(<~>) :: c -> c -> c Source #

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.

Minimal complete definition

lightness, chroma, hue

Methods

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.

pct :: Percent -> Double Source #

Give the decimal value for the given "percent" value.

The Percent value may range from -100 to 100.

pctClamp :: Percent -> Percent Source #

Clamp a Percent value in the range -100 to 100.