Copyright | (c) 2013 Brent Yorgey |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | byorgey@cis.upenn.edu |
Safe Haskell | None |
Language | Haskell2010 |
Utilities for working with color in HSV space.
Right now, the only utility is a function for blending colors in HSV space. This has the effect of "travelling around the color wheel", which can be especially nice when one wants to blend smoothly from one color to another (blending in RGB space can tend to travel across some icky brown/grey colors).
Documentation
hsvBlend :: (Floating a, RealFrac a, VectorSpace a) => Scalar a -> Colour a -> Colour a -> Colour a Source
Blend two colors in HSV space---that is, linearly interpolate
between their hues, saturations, and values independently
(wrapping around appropriately in the case of hue). In
particular, hsvBlend a c1 c2
is like doing (a-1)*c1 + a*c2
in
HSV space. That is, a parameter of 0
results in only the first
color; 1
results in only the second color; and anything in
between results in a blend.