not-gloss-0.7.6.5: Painless 3D graphics, no affiliation with gloss

Safe HaskellSafe
LanguageHaskell98

Vis.GlossColor

Contents

Description

Predefined and custom colors.

Synopsis

Color data type

data Color Source

An abstract color value. We keep the type abstract so we can be sure that the components are in the required range. To make a custom color use makeColor.

makeColor Source

Arguments

:: Float

Red component.

-> Float

Green component.

-> Float

Blue component.

-> Float

Alpha component.

-> Color 

Make a custom color. All components are clamped to the range [0..1].

makeColor' :: Float -> Float -> Float -> Float -> Color Source

Make a custom color. You promise that all components are clamped to the range [0..1]

makeColor8 Source

Arguments

:: Int

Red component.

-> Int

Green component.

-> Int

Blue component.

-> Int

Alpha component.

-> Color 

Make a custom color. All components are clamped to the range [0..255].

rawColor Source

Arguments

:: Float

Red component.

-> Float

Green component.

-> Float

Blue component.

-> Float

Alpha component.

-> Color 

Make a custom color. Components should be in the range [0..1] but this is not checked.

rgbaOfColor :: Color -> (Float, Float, Float, Float) Source

Take the RGBA components of a color.

Color functions

mixColors Source

Arguments

:: Float

Ratio of first color.

-> Float

Ratio of second color.

-> Color

First color.

-> Color

Second color.

-> Color

Resulting color.

Mix two colors with the given ratios.

addColors :: Color -> Color -> Color Source

Add RGB components of a color component-wise, then normalise them to the highest resulting one. The alpha components are averaged.

dim :: Color -> Color Source

Make a dimmer version of a color, scaling towards black.

bright :: Color -> Color Source

Make a brighter version of a color, scaling towards white.

light :: Color -> Color Source

Lighten a color, adding white.

dark :: Color -> Color Source

Darken a color, adding black.

Pre-defined colors

greyN Source

Arguments

:: Float

Range is 0 = black, to 1 = white.

-> Color 

A greyness of a given magnitude.

Primary

Secondary

Tertiary