tamarin-prover-utils-0.8.1.0: Utility library for the tamarin prover.

MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellSafe-Infered

Data.Color

Contents

Description

A simple color module for handling RGB and HSV representations of colors.

Synopsis

Datatypes

data RGB a Source

Constructors

RGB 

Fields

rgbR :: !a
 
rgbG :: !a
 
rgbB :: !a
 

Instances

Functor RGB 
Eq a => Eq (RGB a) 
Ord a => Ord (RGB a) 
Show a => Show (RGB a) 

data HSV a Source

Constructors

HSV 

Fields

hsvH :: !a
 
hsvS :: !a
 
hsvV :: !a
 

Instances

Functor HSV 
Eq a => Eq (HSV a) 
Ord a => Ord (HSV a) 
Show a => Show (HSV a) 

rgbToHex :: RealFrac t => RGB t -> StringSource

Hexadecimal representation of an RGB value

hsvToHex :: RealFrac t => HSV t -> [Char]Source

Hexadecimal representation of an HSV value; i.e., of its corresponding RGB value.

Predefined colors

Conversions

rgbToGray :: Ord t => RGB t -> tSource

hsvToGray :: Num t => HSV t -> HSV tSource

rgbToHSV :: (Fractional t, Ord t) => RGB t -> HSV tSource

RGB to HSV conversion. Pre: 0 <= r,g,b <= 1 (Source: http:de.wikipedia.orgwikiHSV-Farbraum)

hsvToRGB :: RealFrac t => HSV t -> RGB tSource

HSV to RGB conversion. Pre: 0 <= h <= 360 and 0 <= s,v <= 1 (Source: http:de.wikipedia.orgwikiHSV-Farbraum)

Color Palettes

colorGroups :: Double -> [Int] -> [((Int, Int), HSV Double)]Source

Build color groups according to the list of group sizes using the default colorGroupStyle for the function genColorGroups.

lightColorGroups :: Double -> [Int] -> [((Int, Int), HSV Double)]Source

Build color groups according to the list of group sizes using the default light lightColorGroupStyle for the function genColorGroups.