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

Copyright(c) 2010 Simon Meier
LicenseGPL v3 (see LICENSE)
MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellSafe
LanguageHaskell98

Data.Color

Contents

Description

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

Synopsis

Datatypes

data RGB a #

Constructors

RGB 

Fields

Instances

Functor RGB # 

Methods

fmap :: (a -> b) -> RGB a -> RGB b #

(<$) :: a -> RGB b -> RGB a #

Eq a => Eq (RGB a) # 

Methods

(==) :: RGB a -> RGB a -> Bool #

(/=) :: RGB a -> RGB a -> Bool #

Ord a => Ord (RGB a) # 

Methods

compare :: RGB a -> RGB a -> Ordering #

(<) :: RGB a -> RGB a -> Bool #

(<=) :: RGB a -> RGB a -> Bool #

(>) :: RGB a -> RGB a -> Bool #

(>=) :: RGB a -> RGB a -> Bool #

max :: RGB a -> RGB a -> RGB a #

min :: RGB a -> RGB a -> RGB a #

Show a => Show (RGB a) # 

Methods

showsPrec :: Int -> RGB a -> ShowS #

show :: RGB a -> String #

showList :: [RGB a] -> ShowS #

data HSV a #

Constructors

HSV 

Fields

Instances

Functor HSV # 

Methods

fmap :: (a -> b) -> HSV a -> HSV b #

(<$) :: a -> HSV b -> HSV a #

Eq a => Eq (HSV a) # 

Methods

(==) :: HSV a -> HSV a -> Bool #

(/=) :: HSV a -> HSV a -> Bool #

Ord a => Ord (HSV a) # 

Methods

compare :: HSV a -> HSV a -> Ordering #

(<) :: HSV a -> HSV a -> Bool #

(<=) :: HSV a -> HSV a -> Bool #

(>) :: HSV a -> HSV a -> Bool #

(>=) :: HSV a -> HSV a -> Bool #

max :: HSV a -> HSV a -> HSV a #

min :: HSV a -> HSV a -> HSV a #

Show a => Show (HSV a) # 

Methods

showsPrec :: Int -> HSV a -> ShowS #

show :: HSV a -> String #

showList :: [HSV a] -> ShowS #

rgbToHex :: RealFrac t => RGB t -> String #

Hexadecimal representation of an RGB value

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

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

Predefined colors

red :: Fractional t => RGB t #

green :: Fractional t => RGB t #

blue :: Fractional t => RGB t #

Conversions

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

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

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

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

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

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

Color Palettes

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

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)] #

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