Vis-0.7.7.0: Painless 3D graphics, no affiliation with gloss
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vis.GlossColor

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.

Instances

Instances details
Num Color Source # 
Instance details

Defined in Vis.GlossColor

Show Color Source # 
Instance details

Defined in Vis.GlossColor

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

Binary Color Source # 
Instance details

Defined in Vis.VisObject

Methods

put :: Color -> Put #

get :: Get Color #

putList :: [Color] -> Put #

Eq Color Source # 
Instance details

Defined in Vis.GlossColor

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

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