gi-pango-1.0.25: Pango bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Pango.Structs.Color

Description

The PangoColor structure is used to represent a color in an uncalibrated RGB color-space.

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.Pango.Structs.Color

Methods

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

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

GBoxed Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

ManagedPtrNewtype Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

TypedObject Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

Methods

glibType :: IO GType #

HasParentTypes Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

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

Defined in GI.Pango.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.Pango.Structs.Color

type ParentTypes Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

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

newZeroColor :: MonadIO m => m Color Source #

Construct a Color struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

copy, free, parse, parseWithAlpha, toString.

Getters

None.

Setters

None.

copy

colorCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

src: color to copy

-> m (Maybe Color)

Returns: the newly allocated PangoColor, which should be freed with colorFree

Creates a copy of src.

The copy should be freed with colorFree. Primarily used by language bindings, not that useful otherwise (since colors can just be copied by assignment in C).

free

colorFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: an allocated PangoColor

-> m () 

Frees a color allocated by colorCopy.

parse

colorParse Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a PangoColor structure in which to store the result

-> Text

spec: a string specifying the new color

-> m Bool

Returns: True if parsing of the specifier succeeded, otherwise False

Fill in the fields of a color from a string specification.

The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a value in the form #rgb, #rrggbb, #rrrgggbbb or #rrrrggggbbbb, where r, g and b are hex digits of the red, green, and blue components of the color, respectively. (White in the four forms is #fff, #ffffff, #fffffffff and #ffffffffffff.)

parseWithAlpha

colorParseWithAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a PangoColor structure in which to store the result

-> Text

spec: a string specifying the new color

-> m (Bool, Word16)

Returns: True if parsing of the specifier succeeded, otherwise False

Fill in the fields of a color from a string specification.

The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a hexadecimal value in the form #rgb, #rrggbb, #rrrgggbbb or #rrrrggggbbbb where r, g and b are hex digits of the red, green, and blue components of the color, respectively. (White in the four forms is #fff, #ffffff, #fffffffff and #ffffffffffff.)

Additionally, parse strings of the form #rgba, #rrggbbaa, #rrrrggggbbbbaaaa, if alpha is not Nothing, and set alpha to the value specified by the hex digits for a. If no alpha component is found in spec, alpha is set to 0xffff (for a solid color).

Since: 1.46

toString

colorToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a PangoColor

-> m Text

Returns: a newly-allocated text string that must be freed with free.

Returns a textual specification of color.

The string is in the hexadecimal form #rrrrggggbbbb, where r, g and b are hex digits representing the red, green, and blue components respectively.

Since: 1.16

Properties

blue

value of blue component

getColorBlue :: MonadIO m => Color -> m Word16 Source #

Get the value of the “blue” field. When overloading is enabled, this is equivalent to

get color #blue

setColorBlue :: MonadIO m => Color -> Word16 -> m () Source #

Set the value of the “blue” field. When overloading is enabled, this is equivalent to

set color [ #blue := value ]

green

value of green component

getColorGreen :: MonadIO m => Color -> m Word16 Source #

Get the value of the “green” field. When overloading is enabled, this is equivalent to

get color #green

setColorGreen :: MonadIO m => Color -> Word16 -> m () Source #

Set the value of the “green” field. When overloading is enabled, this is equivalent to

set color [ #green := value ]

red

value of red component

getColorRed :: MonadIO m => Color -> m Word16 Source #

Get the value of the “red” field. When overloading is enabled, this is equivalent to

get color #red

setColorRed :: MonadIO m => Color -> Word16 -> m () Source #

Set the value of the “red” field. When overloading is enabled, this is equivalent to

set color [ #red := value ]