| Copyright | (C) 2013 Parnell Springmeyer |
|---|---|
| License | BSD3 |
| Maintainer | Parnell Springmeyer <parnell@digitalmentat.com> |
| Stability | stable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Prizm.Color
Contents
Description
Data.Prizm.Color exports all of the specific color space modules
and types for blending colors, convenience blending (tint and
shade), and adjusting the hue, lightness, or chroma of a
given color. You should import this module.
Note that blending colors in a polar-coordinate color space, such
as CIELCH, preserves the saturation and brightness of the colors
being interpolated better than blending in RGB. It also turns out
to be an effective even when converting from RGB to CIELCH,
blending, then converting back again!
Here is an excellent blog post by someone discussing the differences: Improved Color Blending.
- interpolate :: BlendableColor c => Percent -> (c, c) -> c
- (<~>) :: BlendableColor c => c -> c -> c
- shade :: (BlendableColor c, PresetColor c) => c -> Percent -> c
- tint :: (BlendableColor c, PresetColor c) => c -> Percent -> c
- lightness :: AdjustableColor c => c -> Percent -> c
- chroma :: AdjustableColor c => c -> Percent -> c
- hue :: AdjustableColor c => c -> Percent -> c
- white :: PresetColor c => c
- black :: PresetColor c => c
- module Data.Prizm.Color.CIE
- module Data.Prizm.Color.RGB
- module Data.Prizm.Types
Color Transformations
interpolate :: BlendableColor c => Percent -> (c, c) -> c Source #
Linear interpolation of a color with another color, applying a weight.
(<~>) :: BlendableColor c => c -> c -> c Source #
Blend two BlendableColor colors using an interpolation weight
of 50%.
shade :: (BlendableColor c, PresetColor c) => c -> Percent -> c Source #
Shade a color by blending it using a weight and the
PresetColor black.
tint :: (BlendableColor c, PresetColor c) => c -> Percent -> c Source #
Tint a color by blending it using a weight and the
PresetColor white.
chroma :: AdjustableColor c => 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
Preset Colors
Individual Color Spaces
CIE Color Space
module Data.Prizm.Color.CIE
RGB Color Space
module Data.Prizm.Color.RGB
Package Types (re-exports the individual color space type modules too)
module Data.Prizm.Types