reanimate-1.0.0.0: Animation library based on SVGs.

Safe HaskellNone
LanguageHaskell2010

Reanimate.ColorComponents

Description

Colors are three dimensional and can be projected into many color spaces with different properties.

Interpolating directly in the RGB color space is unintuitive and rarely useful. If you want to transition through color, you most likely want either the XYZ space (for physically accurate color transitions) or the LAB space (for esthetically pleasing colors).

Synopsis

Documentation

data ColorComponents Source #

Constructor and destructor for color's three components.

Constructors

ColorComponents 

Fields

rgbComponents :: ColorComponents Source #

interpolate rgbComponents yellow blue

hsvComponents :: ColorComponents Source #

interpolate hsvComponents yellow blue

labComponents :: ColorComponents Source #

interpolate labComponents yellow blue

xyzComponents :: ColorComponents Source #

interpolate xyzComponents yellow blue

lchComponents :: ColorComponents Source #

interpolate lchComponents yellow blue

interpolate :: ColorComponents -> Colour Double -> Colour Double -> Double -> Colour Double Source #

Smoothly interpolate between two colors using the given color components.

interpolateRGB8 :: ColorComponents -> PixelRGB8 -> PixelRGB8 -> Double -> PixelRGB8 Source #

Convenience interpolation function for RGB8 values.

interpolateRGBA8 :: ColorComponents -> PixelRGBA8 -> PixelRGBA8 -> Double -> PixelRGBA8 Source #

Convenience interpolation function for RGBA8 values.

toRGB8 :: Colour Double -> PixelRGB8 Source #

Convenience function for expressing a color as an RGB8 value.

fromRGB8 :: PixelRGB8 -> Colour Double Source #

Convenience function for expressing an RGB8 value as a color.