colour-accelerate-0.4.0.0: Working with colours in Accelerate

Copyright[2016..2020] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.Data.Colour.RGB

Description

RGB triples for an unspecified colour space

Synopsis

Documentation

type Colour = RGB Float Source #

An RGB colour value, in an unspecified colour space.

data RGB a Source #

An RGB colour value to hold the colour components. All components lie in the range [0..1] for floating point values, or [0..255] for byte values.

Colours in the floating point representation are stored in the usual unzipped struct-of-array representation. Colours with Word8 components are stored in a packed array-of-struct representation, which is typically more convenient when exporting the data (e.g. as a 24-bit BMP image).

Constructors

RGB a a a 
Instances
Functor RGB Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

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

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

Lift Exp (RGB Float) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type Plain (RGB Float) :: Type #

Methods

lift :: RGB Float -> Exp (Plain (RGB Float)) #

Lift Exp (RGB Word8) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type Plain (RGB Word8) :: Type #

Methods

lift :: RGB Word8 -> Exp (Plain (RGB Word8)) #

Lift Exp (RGB (Exp Float)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type Plain (RGB (Exp Float)) :: Type #

Methods

lift :: RGB (Exp Float) -> Exp (Plain (RGB (Exp Float))) #

Lift Exp (RGB (Exp Word8)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type Plain (RGB (Exp Word8)) :: Type #

Methods

lift :: RGB (Exp Word8) -> Exp (Plain (RGB (Exp Word8))) #

Unlift Exp (RGB (Exp Float)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

unlift :: Exp (Plain (RGB (Exp Float))) -> RGB (Exp Float) #

Unlift Exp (RGB (Exp Word8)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

unlift :: Exp (Plain (RGB (Exp Word8))) -> RGB (Exp Word8) #

Eq a => Eq (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

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

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

(Fractional a, Unlift Exp (RGB (Exp a)), Plain (RGB (Exp a)) ~ RGB a) => Fractional (Exp (RGB a)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

(/) :: Exp (RGB a) -> Exp (RGB a) -> Exp (RGB a) #

recip :: Exp (RGB a) -> Exp (RGB a) #

fromRational :: Rational -> Exp (RGB a) #

(Num a, Fractional a) => Fractional (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

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

recip :: RGB a -> RGB a #

fromRational :: Rational -> RGB a #

(Num a, Unlift Exp (RGB (Exp a)), Plain (RGB (Exp a)) ~ RGB a) => Num (Exp (RGB a)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

(+) :: Exp (RGB a) -> Exp (RGB a) -> Exp (RGB a) #

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

(*) :: Exp (RGB a) -> Exp (RGB a) -> Exp (RGB a) #

negate :: Exp (RGB a) -> Exp (RGB a) #

abs :: Exp (RGB a) -> Exp (RGB a) #

signum :: Exp (RGB a) -> Exp (RGB a) #

fromInteger :: Integer -> Exp (RGB a) #

Num a => Num (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

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

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

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

negate :: RGB a -> RGB a #

abs :: RGB a -> RGB a #

signum :: RGB a -> RGB a #

fromInteger :: Integer -> RGB a #

Show a => Show (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

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

show :: RGB a -> String #

showList :: [RGB a] -> ShowS #

Generic (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type Rep (RGB a) :: Type -> Type #

Methods

from :: RGB a -> Rep (RGB a) x #

to :: Rep (RGB a) x -> RGB a #

Elt (RGB Float) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type EltR (RGB Float) :: Type

Methods

eltR :: TypeR (EltR (RGB Float))

tagsR :: [TagR (EltR (RGB Float))]

fromElt :: RGB Float -> EltR (RGB Float)

toElt :: EltR (RGB Float) -> RGB Float

Elt (RGB Word8) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Associated Types

type EltR (RGB Word8) :: Type

Methods

eltR :: TypeR (EltR (RGB Word8))

tagsR :: [TagR (EltR (RGB Word8))]

fromElt :: RGB Word8 -> EltR (RGB Word8)

toElt :: EltR (RGB Word8) -> RGB Word8

NamedColour (RGB Float) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

antiqueWhite :: RGB Float Source #

azure :: RGB Float Source #

bisque :: RGB Float Source #

blanchedAlmond :: RGB Float Source #

cornsilk :: RGB Float Source #

eggshell :: RGB Float Source #

floralWhite :: RGB Float Source #

gainsboro :: RGB Float Source #

ghostWhite :: RGB Float Source #

honeydew :: RGB Float Source #

ivory :: RGB Float Source #

lavender :: RGB Float Source #

lavenderBlush :: RGB Float Source #

lemonChiffon :: RGB Float Source #

linen :: RGB Float Source #

mintCream :: RGB Float Source #

mistyRose :: RGB Float Source #

moccasin :: RGB Float Source #

navajoWhite :: RGB Float Source #

oldLace :: RGB Float Source #

papayaWhip :: RGB Float Source #

peachPuff :: RGB Float Source #

seashell :: RGB Float Source #

snow :: RGB Float Source #

thistle :: RGB Float Source #

titaniumWhite :: RGB Float Source #

wheat :: RGB Float Source #

white :: RGB Float Source #

whiteSmoke :: RGB Float Source #

zincWhite :: RGB Float Source #

coldGrey :: RGB Float Source #

dimGrey :: RGB Float Source #

grey :: RGB Float Source #

lightGrey :: RGB Float Source #

slateGrey :: RGB Float Source #

slateGreyDark :: RGB Float Source #

slateGreyLight :: RGB Float Source #

warmGrey :: RGB Float Source #

black :: RGB Float Source #

ivoryBlack :: RGB Float Source #

lampBlack :: RGB Float Source #

alizarinCrimson :: RGB Float Source #

brick :: RGB Float Source #

cadmiumRedDeep :: RGB Float Source #

coral :: RGB Float Source #

coralLight :: RGB Float Source #

deepPink :: RGB Float Source #

englishRed :: RGB Float Source #

firebrick :: RGB Float Source #

geraniumLake :: RGB Float Source #

hotPink :: RGB Float Source #

indianRed :: RGB Float Source #

lightSalmon :: RGB Float Source #

madderLakeDeep :: RGB Float Source #

maroon :: RGB Float Source #

pink :: RGB Float Source #

pinkLight :: RGB Float Source #

raspberry :: RGB Float Source #

red :: RGB Float Source #

roseMadder :: RGB Float Source #

salmon :: RGB Float Source #

tomato :: RGB Float Source #

venetianRed :: RGB Float Source #

beige :: RGB Float Source #

brown :: RGB Float Source #

brownMadder :: RGB Float Source #

brownOchre :: RGB Float Source #

burlywood :: RGB Float Source #

burntSienna :: RGB Float Source #

burntUmber :: RGB Float Source #

chocolate :: RGB Float Source #

deepOchre :: RGB Float Source #

flesh :: RGB Float Source #

fleshOchre :: RGB Float Source #

goldOchre :: RGB Float Source #

greenishUmber :: RGB Float Source #

khaki :: RGB Float Source #

khakiDark :: RGB Float Source #

lightBeige :: RGB Float Source #

peru :: RGB Float Source #

rosyBrown :: RGB Float Source #

rawSienna :: RGB Float Source #

rawUmber :: RGB Float Source #

sepia :: RGB Float Source #

sienna :: RGB Float Source #

saddleBrown :: RGB Float Source #

sandyBrown :: RGB Float Source #

tan :: RGB Float Source #

vanDykeBrown :: RGB Float Source #

cadmiumOrange :: RGB Float Source #

cadmiumRedLight :: RGB Float Source #

carrot :: RGB Float Source #

darkOrange :: RGB Float Source #

marsOrange :: RGB Float Source #

marsYellow :: RGB Float Source #

orange :: RGB Float Source #

orangeRed :: RGB Float Source #

yellowOchre :: RGB Float Source #

aureolineYellow :: RGB Float Source #

banana :: RGB Float Source #

cadmiumLemon :: RGB Float Source #

cadmiumYellow :: RGB Float Source #

gold :: RGB Float Source #

goldenrod :: RGB Float Source #

goldenrodDark :: RGB Float Source #

goldenrodLight :: RGB Float Source #

goldenrodPale :: RGB Float Source #

lightGoldenrod :: RGB Float Source #

melon :: RGB Float Source #

naplesYellowDeep :: RGB Float Source #

yellow :: RGB Float Source #

yellowLight :: RGB Float Source #

chartreuse :: RGB Float Source #

chromeoxideGreen :: RGB Float Source #

cinnabarGreen :: RGB Float Source #

cobaltGreen :: RGB Float Source #

emeraldGreen :: RGB Float Source #

forestGreen :: RGB Float Source #

green :: RGB Float Source #

greenDark :: RGB Float Source #

greenPale :: RGB Float Source #

greenYellow :: RGB Float Source #

lawnGreen :: RGB Float Source #

limeGreen :: RGB Float Source #

mint :: RGB Float Source #

olive :: RGB Float Source #

oliveDrab :: RGB Float Source #

oliveGreenDark :: RGB Float Source #

permanentGreen :: RGB Float Source #

sapGreen :: RGB Float Source #

seaGreen :: RGB Float Source #

seaGreenDark :: RGB Float Source #

seaGreenMedium :: RGB Float Source #

seaGreenLight :: RGB Float Source #

springGreen :: RGB Float Source #

springGreenMedium :: RGB Float Source #

terreVerte :: RGB Float Source #

viridianLight :: RGB Float Source #

yellowGreen :: RGB Float Source #

aquamarine :: RGB Float Source #

aquamarineMedium :: RGB Float Source #

cyan :: RGB Float Source #

cyanWhite :: RGB Float Source #

turquoise :: RGB Float Source #

turquoiseDark :: RGB Float Source #

turquoiseMedium :: RGB Float Source #

turquoisePale :: RGB Float Source #

aliceBlue :: RGB Float Source #

blue :: RGB Float Source #

blueLight :: RGB Float Source #

blueMedium :: RGB Float Source #

cadet :: RGB Float Source #

cobalt :: RGB Float Source #

cornflower :: RGB Float Source #

cerulean :: RGB Float Source #

dodgerBlue :: RGB Float Source #

indigo :: RGB Float Source #

manganeseBlue :: RGB Float Source #

midnightBlue :: RGB Float Source #

navy :: RGB Float Source #

peacock :: RGB Float Source #

powderBlue :: RGB Float Source #

royalBlue :: RGB Float Source #

slateBlue :: RGB Float Source #

slateBlueDark :: RGB Float Source #

slateBlueLight :: RGB Float Source #

slateBlueMedium :: RGB Float Source #

skyBlue :: RGB Float Source #

skyBlueDeep :: RGB Float Source #

skyBlueLight :: RGB Float Source #

steelBlue :: RGB Float Source #

steelBlueLight :: RGB Float Source #

turquoiseBlue :: RGB Float Source #

ultramarine :: RGB Float Source #

blueViolet :: RGB Float Source #

cobaltVioletDeep :: RGB Float Source #

magenta :: RGB Float Source #

orchid :: RGB Float Source #

orchidDark :: RGB Float Source #

orchidMedium :: RGB Float Source #

permanentViolet :: RGB Float Source #

plum :: RGB Float Source #

purple :: RGB Float Source #

purpleMedium :: RGB Float Source #

ultramarineViolet :: RGB Float Source #

violet :: RGB Float Source #

violetDark :: RGB Float Source #

violetRed :: RGB Float Source #

violetRedMedium :: RGB Float Source #

violetRedPale :: RGB Float Source #

NamedColour (RGB Word8) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

Methods

antiqueWhite :: RGB Word8 Source #

azure :: RGB Word8 Source #

bisque :: RGB Word8 Source #

blanchedAlmond :: RGB Word8 Source #

cornsilk :: RGB Word8 Source #

eggshell :: RGB Word8 Source #

floralWhite :: RGB Word8 Source #

gainsboro :: RGB Word8 Source #

ghostWhite :: RGB Word8 Source #

honeydew :: RGB Word8 Source #

ivory :: RGB Word8 Source #

lavender :: RGB Word8 Source #

lavenderBlush :: RGB Word8 Source #

lemonChiffon :: RGB Word8 Source #

linen :: RGB Word8 Source #

mintCream :: RGB Word8 Source #

mistyRose :: RGB Word8 Source #

moccasin :: RGB Word8 Source #

navajoWhite :: RGB Word8 Source #

oldLace :: RGB Word8 Source #

papayaWhip :: RGB Word8 Source #

peachPuff :: RGB Word8 Source #

seashell :: RGB Word8 Source #

snow :: RGB Word8 Source #

thistle :: RGB Word8 Source #

titaniumWhite :: RGB Word8 Source #

wheat :: RGB Word8 Source #

white :: RGB Word8 Source #

whiteSmoke :: RGB Word8 Source #

zincWhite :: RGB Word8 Source #

coldGrey :: RGB Word8 Source #

dimGrey :: RGB Word8 Source #

grey :: RGB Word8 Source #

lightGrey :: RGB Word8 Source #

slateGrey :: RGB Word8 Source #

slateGreyDark :: RGB Word8 Source #

slateGreyLight :: RGB Word8 Source #

warmGrey :: RGB Word8 Source #

black :: RGB Word8 Source #

ivoryBlack :: RGB Word8 Source #

lampBlack :: RGB Word8 Source #

alizarinCrimson :: RGB Word8 Source #

brick :: RGB Word8 Source #

cadmiumRedDeep :: RGB Word8 Source #

coral :: RGB Word8 Source #

coralLight :: RGB Word8 Source #

deepPink :: RGB Word8 Source #

englishRed :: RGB Word8 Source #

firebrick :: RGB Word8 Source #

geraniumLake :: RGB Word8 Source #

hotPink :: RGB Word8 Source #

indianRed :: RGB Word8 Source #

lightSalmon :: RGB Word8 Source #

madderLakeDeep :: RGB Word8 Source #

maroon :: RGB Word8 Source #

pink :: RGB Word8 Source #

pinkLight :: RGB Word8 Source #

raspberry :: RGB Word8 Source #

red :: RGB Word8 Source #

roseMadder :: RGB Word8 Source #

salmon :: RGB Word8 Source #

tomato :: RGB Word8 Source #

venetianRed :: RGB Word8 Source #

beige :: RGB Word8 Source #

brown :: RGB Word8 Source #

brownMadder :: RGB Word8 Source #

brownOchre :: RGB Word8 Source #

burlywood :: RGB Word8 Source #

burntSienna :: RGB Word8 Source #

burntUmber :: RGB Word8 Source #

chocolate :: RGB Word8 Source #

deepOchre :: RGB Word8 Source #

flesh :: RGB Word8 Source #

fleshOchre :: RGB Word8 Source #

goldOchre :: RGB Word8 Source #

greenishUmber :: RGB Word8 Source #

khaki :: RGB Word8 Source #

khakiDark :: RGB Word8 Source #

lightBeige :: RGB Word8 Source #

peru :: RGB Word8 Source #

rosyBrown :: RGB Word8 Source #

rawSienna :: RGB Word8 Source #

rawUmber :: RGB Word8 Source #

sepia :: RGB Word8 Source #

sienna :: RGB Word8 Source #

saddleBrown :: RGB Word8 Source #

sandyBrown :: RGB Word8 Source #

tan :: RGB Word8 Source #

vanDykeBrown :: RGB Word8 Source #

cadmiumOrange :: RGB Word8 Source #

cadmiumRedLight :: RGB Word8 Source #

carrot :: RGB Word8 Source #

darkOrange :: RGB Word8 Source #

marsOrange :: RGB Word8 Source #

marsYellow :: RGB Word8 Source #

orange :: RGB Word8 Source #

orangeRed :: RGB Word8 Source #

yellowOchre :: RGB Word8 Source #

aureolineYellow :: RGB Word8 Source #

banana :: RGB Word8 Source #

cadmiumLemon :: RGB Word8 Source #

cadmiumYellow :: RGB Word8 Source #

gold :: RGB Word8 Source #

goldenrod :: RGB Word8 Source #

goldenrodDark :: RGB Word8 Source #

goldenrodLight :: RGB Word8 Source #

goldenrodPale :: RGB Word8 Source #

lightGoldenrod :: RGB Word8 Source #

melon :: RGB Word8 Source #

naplesYellowDeep :: RGB Word8 Source #

yellow :: RGB Word8 Source #

yellowLight :: RGB Word8 Source #

chartreuse :: RGB Word8 Source #

chromeoxideGreen :: RGB Word8 Source #

cinnabarGreen :: RGB Word8 Source #

cobaltGreen :: RGB Word8 Source #

emeraldGreen :: RGB Word8 Source #

forestGreen :: RGB Word8 Source #

green :: RGB Word8 Source #

greenDark :: RGB Word8 Source #

greenPale :: RGB Word8 Source #

greenYellow :: RGB Word8 Source #

lawnGreen :: RGB Word8 Source #

limeGreen :: RGB Word8 Source #

mint :: RGB Word8 Source #

olive :: RGB Word8 Source #

oliveDrab :: RGB Word8 Source #

oliveGreenDark :: RGB Word8 Source #

permanentGreen :: RGB Word8 Source #

sapGreen :: RGB Word8 Source #

seaGreen :: RGB Word8 Source #

seaGreenDark :: RGB Word8 Source #

seaGreenMedium :: RGB Word8 Source #

seaGreenLight :: RGB Word8 Source #

springGreen :: RGB Word8 Source #

springGreenMedium :: RGB Word8 Source #

terreVerte :: RGB Word8 Source #

viridianLight :: RGB Word8 Source #

yellowGreen :: RGB Word8 Source #

aquamarine :: RGB Word8 Source #

aquamarineMedium :: RGB Word8 Source #

cyan :: RGB Word8 Source #

cyanWhite :: RGB Word8 Source #

turquoise :: RGB Word8 Source #

turquoiseDark :: RGB Word8 Source #

turquoiseMedium :: RGB Word8 Source #

turquoisePale :: RGB Word8 Source #

aliceBlue :: RGB Word8 Source #

blue :: RGB Word8 Source #

blueLight :: RGB Word8 Source #

blueMedium :: RGB Word8 Source #

cadet :: RGB Word8 Source #

cobalt :: RGB Word8 Source #

cornflower :: RGB Word8 Source #

cerulean :: RGB Word8 Source #

dodgerBlue :: RGB Word8 Source #

indigo :: RGB Word8 Source #

manganeseBlue :: RGB Word8 Source #

midnightBlue :: RGB Word8 Source #

navy :: RGB Word8 Source #

peacock :: RGB Word8 Source #

powderBlue :: RGB Word8 Source #

royalBlue :: RGB Word8 Source #

slateBlue :: RGB Word8 Source #

slateBlueDark :: RGB Word8 Source #

slateBlueLight :: RGB Word8 Source #

slateBlueMedium :: RGB Word8 Source #

skyBlue :: RGB Word8 Source #

skyBlueDeep :: RGB Word8 Source #

skyBlueLight :: RGB Word8 Source #

steelBlue :: RGB Word8 Source #

steelBlueLight :: RGB Word8 Source #

turquoiseBlue :: RGB Word8 Source #

ultramarine :: RGB Word8 Source #

blueViolet :: RGB Word8 Source #

cobaltVioletDeep :: RGB Word8 Source #

magenta :: RGB Word8 Source #

orchid :: RGB Word8 Source #

orchidDark :: RGB Word8 Source #

orchidMedium :: RGB Word8 Source #

permanentViolet :: RGB Word8 Source #

plum :: RGB Word8 Source #

purple :: RGB Word8 Source #

purpleMedium :: RGB Word8 Source #

ultramarineViolet :: RGB Word8 Source #

violet :: RGB Word8 Source #

violetDark :: RGB Word8 Source #

violetRed :: RGB Word8 Source #

violetRedMedium :: RGB Word8 Source #

violetRedPale :: RGB Word8 Source #

type Rep (RGB a) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type Rep (RGB a) = D1 (MetaData "RGB" "Data.Array.Accelerate.Data.Colour.RGB" "colour-accelerate-0.4.0.0-GZgvVFgNlpQ9AsTfi6pN5F" False) (C1 (MetaCons "RGB" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))
type EltR (RGB Float) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type EltR (RGB Float) = Vec3 Float
type EltR (RGB Word8) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type EltR (RGB Word8) = Vec3 Word8
type Plain (RGB Float) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type Plain (RGB Word8) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type Plain (RGB (Exp Float)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type Plain (RGB (Exp Float)) = RGB Float
type Plain (RGB (Exp Word8)) Source # 
Instance details

Defined in Data.Array.Accelerate.Data.Colour.RGB

type Plain (RGB (Exp Word8)) = RGB Word8

pattern RGB_ :: (Elt (RGB a), Elt a, VecElt a, EltR (RGB a) ~ Vec3 a) => Exp a -> Exp a -> Exp a -> Exp (RGB a) Source #

rgb Source #

Arguments

:: Exp Float

red component

-> Exp Float

green component

-> Exp Float

blue component

-> Exp Colour 

Construct an RGB colour from individual channel components. The components will be clamped to the range [0..1].

rgb8 Source #

Arguments

:: Exp Word8

red component

-> Exp Word8

green component

-> Exp Word8

blue component

-> Exp Colour 

Construct a colour from 8-bit-per-channel colour components.

clamp :: Exp Colour -> Exp Colour Source #

Clamp each component of a colour to the range [0..1].

blend Source #

Arguments

:: Exp Float

Proportion of first colour

-> Exp Float

Proportion of second colour

-> Exp Colour

First colour

-> Exp Colour

Second colour

-> Exp Colour

Resulting colour

Blend two colours in the given proportions.

Note that this uses an approximation of gamma=2 (i.e. sum-of-squares method). It is recommended to instead convert to the sRGB colour space if you want more accurate colour blending, or if you intend to use the gamma-corrected values more than once (e.g. in a stencil).

blend c1 c2 ~= SRGB.toRGB ( (SRGB.fromRGB c1 + SRGB.fromRGB c2) / 2 )

See the Blur program in the examples for a comparison of mixing colours in the RGB and sRGB colour spaces.

luminance :: Exp Colour -> Exp Float Source #

Luminance of an RGB colour (Y component of a YUV colour).

packRGB :: Exp Colour -> Exp Word32 Source #

Convert a Colour into a packed-word RGBA representation

packBGR :: Exp Colour -> Exp Word32 Source #

Convert a colour into a packed-word ABGR representation

unpackRGB :: Exp Word32 -> Exp Colour Source #

Convert a colour from a packed-word RGBA representation

unpackBGR :: Exp Word32 -> Exp Colour Source #

Convert a colour from a packed-word ABGR representation