gloss-1.9.3.1: Painless 2D vector graphics, animations and simulations.

Safe HaskellNone
LanguageHaskell98

Graphics.Gloss.Data.Color

Contents

Description

Predefined and custom colors.

Synopsis

Color data type

data Color :: *

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

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].

makeColorI :: Int -> Int -> Int -> Int -> Color

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

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

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 order.

Primary

Secondary

Tertiary