weekdaze-0.0.0.3: A school-timetable problem-solver.

Safe HaskellSafe
LanguageHaskell2010

WeekDaze.Colour.HTMLColour

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Exports some colour-composition functions for HTML.
Synopsis

Functions

unitIntervalToHTMLColourCode :: (RealFrac unitInterval, Show unitInterval) => unitInterval -> HTMLColourCode Source #

unitIntervalToRGB Source #

Arguments

:: (Fractional alpha, Fractional unitInterval, Real alpha, Real unitInterval, Show alpha, Show unitInterval) 
=> alpha

The angular span in the range [0 .. 2 * pi radians], to which the unit-interval is mapped.

-> alpha

The angular offset in radians.

-> unitInterval

The saturation in the unit-interval; 0 will always result in black.

-> unitInterval

The value in the unit-interval which is to be represented by a colour.

-> RGB unitInterval 
  • Maps the specified value from the unit-interval to the corresponding spectral colour represented as RGB.
  • The mapping from the spectrum to RGB is performed by modeling the spectrum as a circular arc drawn on the colour triangle, of radius equal to the specified saturation, & centered on green. CAVEAT: this algorithm has no solid basis.
  • One may specify the angular span & angular offset of this arc, to define the values to which 0 & 1 map.

Translation

htmlColourCodeToRGB :: (Integral i, Show i) => HTMLColourCode -> RGB i Source #

Represents the specified HTML colour-code as RGB 24-bit.

rgbUnitIntervalToHTMLColourCode Source #

Arguments

:: RealFrac unitInterval 
=> RGB unitInterval

Red, green & blue component-colours, each in the unit-interval.

-> HTMLColourCode 

Represents the specified RGB as an HTML colour-code.