gi-cogl-1.0.2: COGL GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Cogl.Structs.Color

Description

A structure for holding a color definition. The contents of the CoglColor structure are private and should never by accessed directly.

Since: 1.0

Synopsis

Exported types

newtype Color Source #

Memory-managed wrapper type.

Constructors

Color (ManagedPtr Color) 

Instances

Instances details
Eq Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

Methods

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

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

GBoxed Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

ManagedPtrNewtype Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

TypedObject Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

Methods

glibType :: IO GType #

HasParentTypes Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

tag ~ 'AttrSet => Constructible Color tag Source # 
Instance details

Defined in GI.Cogl.Structs.Color

Methods

new :: MonadIO m => (ManagedPtr Color -> Color) -> [AttrOp Color tag] -> m Color #

IsGValue (Maybe Color) Source #

Convert Color to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Cogl.Structs.Color

type ParentTypes Color Source # 
Instance details

Defined in GI.Cogl.Structs.Color

type ParentTypes Color = '[] :: [Type]

newZeroColor :: MonadIO m => m Color Source #

Construct a Color struct initialized to zero.

Methods

copy

colorCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: the color to copy

-> m Color

Returns: a newly-allocated Color. Use colorFree to free the allocate resources

Creates a copy of color

Since: 1.0

equal

colorEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ptr ()

v1: a Color

-> Ptr ()

v2: a Color

-> m Int32

Returns: True if the two colors are the same.

Compares two Colors and checks if they are the same.

This function can be passed to g_hash_table_new() as the keyEqualFunc parameter, when using Colors as keys in a HashTable.

Since: 1.0

free

colorFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: the color to free

-> m () 

Frees the resources allocated by colorNew and colorCopy

Since: 1.0

getAlpha

colorGetAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the alpha channel of the passed color

Retrieves the alpha channel of color as a fixed point value between 0 and 1.0.

Since: 1.0

getAlphaByte

colorGetAlphaByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Word8

Returns: the alpha channel of the passed color

Retrieves the alpha channel of color as a byte value between 0 and 255

Since: 1.0

getAlphaFloat

colorGetAlphaFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the alpha channel of the passed color

Retrieves the alpha channel of color as a floating point value between 0.0 and 1.0

Since: 1.0

getBlue

colorGetBlue Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the blue channel of the passed color

Retrieves the blue channel of color as a fixed point value between 0 and 1.0.

Since: 1.0

getBlueByte

colorGetBlueByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Word8

Returns: the blue channel of the passed color

Retrieves the blue channel of color as a byte value between 0 and 255

Since: 1.0

getBlueFloat

colorGetBlueFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the blue channel of the passed color

Retrieves the blue channel of color as a floating point value between 0.0 and 1.0

Since: 1.0

getGreen

colorGetGreen Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the green channel of the passed color

Retrieves the green channel of color as a fixed point value between 0 and 1.0.

Since: 1.0

getGreenByte

colorGetGreenByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Word8

Returns: the green channel of the passed color

Retrieves the green channel of color as a byte value between 0 and 255

Since: 1.0

getGreenFloat

colorGetGreenFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the green channel of the passed color

Retrieves the green channel of color as a floating point value between 0.0 and 1.0

Since: 1.0

getRed

colorGetRed Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the red channel of the passed color

Retrieves the red channel of color as a fixed point value between 0 and 1.0.

Since: 1.0

getRedByte

colorGetRedByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Word8

Returns: the red channel of the passed color

Retrieves the red channel of color as a byte value between 0 and 255

Since: 1.0

getRedFloat

colorGetRedFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Float

Returns: the red channel of the passed color

Retrieves the red channel of color as a floating point value between 0.0 and 1.0

Since: 1.0

initFrom4f

colorInitFrom4f Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: A pointer to a Color to initialize

-> Float

red: value of the red channel, between 0 and 1.0

-> Float

green: value of the green channel, between 0 and 1.0

-> Float

blue: value of the blue channel, between 0 and 1.0

-> Float

alpha: value of the alpha channel, between 0 and 1.0

-> m () 

Sets the values of the passed channels into a Color

Since: 1.4

initFrom4fv

colorInitFrom4fv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: A pointer to a Color to initialize

-> Float

colorArray: a pointer to an array of 4 float color components

-> m () 

Sets the values of the passed channels into a Color

Since: 1.4

initFrom4ub

colorInitFrom4ub Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: A pointer to a Color to initialize

-> Word8

red: value of the red channel, between 0 and 255

-> Word8

green: value of the green channel, between 0 and 255

-> Word8

blue: value of the blue channel, between 0 and 255

-> Word8

alpha: value of the alpha channel, between 0 and 255

-> m () 

Sets the values of the passed channels into a Color.

Since: 1.4

initFromHsl

colorInitFromHsl Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

hue: hue value, in the 0 .. 360 range

-> Float

saturation: saturation value, in the 0 .. 1 range

-> Float

luminance: luminance value, in the 0 .. 1 range

-> m Color 

Converts a color expressed in HLS (hue, luminance and saturation) values into a Color.

Since: 1.16

new

colorNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Color

Returns: a newly-allocated Color. Use colorFree to free the allocated resources

Creates a new (empty) color

Since: 1.0

premultiply

colorPremultiply Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: the color to premultiply

-> m () 

Converts a non-premultiplied color to a pre-multiplied color. For example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied and (0.5, 0, 0, 0.5) when premultiplied.

Since: 1.0

setAlpha

colorSetAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

alpha: a float value between 0.0f and 1.0f

-> m () 

Sets the alpha channel of color to alpha.

Since: 1.4

setAlphaByte

colorSetAlphaByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Word8

alpha: a byte value between 0 and 255

-> m () 

Sets the alpha channel of color to alpha.

Since: 1.4

setAlphaFloat

colorSetAlphaFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

alpha: a float value between 0.0f and 1.0f

-> m () 

Sets the alpha channel of color to alpha.

Since: 1.4

setBlue

colorSetBlue Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

blue: a float value between 0.0f and 1.0f

-> m () 

Sets the blue channel of color to blue.

Since: 1.4

setBlueByte

colorSetBlueByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Word8

blue: a byte value between 0 and 255

-> m () 

Sets the blue channel of color to blue.

Since: 1.4

setBlueFloat

colorSetBlueFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

blue: a float value between 0.0f and 1.0f

-> m () 

Sets the blue channel of color to blue.

Since: 1.4

setFrom4f

colorSetFrom4f Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: A pointer to a Color to initialize

-> Float

red: value of the red channel, between 0 and 1.0

-> Float

green: value of the green channel, between 0 and 1.0

-> Float

blue: value of the blue channel, between 0 and 1.0

-> Float

alpha: value of the alpha channel, between 0 and 1.0

-> m () 

Deprecated: (Since version 1.4)Use cogl_color_init_from_4f instead.

Sets the values of the passed channels into a Color

Since: 1.0

setFrom4ub

colorSetFrom4ub Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: A pointer to a Color to initialize

-> Word8

red: value of the red channel, between 0 and 255

-> Word8

green: value of the green channel, between 0 and 255

-> Word8

blue: value of the blue channel, between 0 and 255

-> Word8

alpha: value of the alpha channel, between 0 and 255

-> m () 

Deprecated: (Since version 1.4)Use cogl_color_init_from_4ub instead.

Sets the values of the passed channels into a Color.

Since: 1.0

setGreen

colorSetGreen Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

green: a float value between 0.0f and 1.0f

-> m () 

Sets the green channel of color to green.

Since: 1.4

setGreenByte

colorSetGreenByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Word8

green: a byte value between 0 and 255

-> m () 

Sets the green channel of color to green.

Since: 1.4

setGreenFloat

colorSetGreenFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

green: a float value between 0.0f and 1.0f

-> m () 

Sets the green channel of color to green.

Since: 1.4

setRed

colorSetRed Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

red: a float value between 0.0f and 1.0f

-> m () 

Sets the red channel of color to red.

Since: 1.4

setRedByte

colorSetRedByte Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Word8

red: a byte value between 0 and 255

-> m () 

Sets the red channel of color to red.

Since: 1.4

setRedFloat

colorSetRedFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> Float

red: a float value between 0.0f and 1.0f

-> m () 

Sets the red channel of color to red.

Since: 1.4

toHsl

colorToHsl Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m (Float, Float, Float) 

Converts color to the HLS format.

The hue value is in the 0 .. 360 range. The luminance and saturation values are in the 0 .. 1 range.

Since: 1.16

unpremultiply

colorUnpremultiply Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: the color to unpremultiply

-> m () 

Converts a pre-multiplied color to a non-premultiplied color. For example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied and (1.0, 0, 0, 0.5) when non-premultiplied.

Since: 1.4