gi-pango-1.0.20: Pango bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Pango.Structs.Color

Contents

Description

The Color 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
BoxedObject Color Source # 
Instance details

Defined in GI.Pango.Structs.Color

Methods

boxedType :: Color -> IO GType

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

newZeroColor :: MonadIO m => m Color Source #

Construct a Color struct initialized to zero.

noColor :: Maybe Color Source #

A convenience alias for Nothing :: Maybe Color.

Methods

copy

colorCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

src: color to copy, may be Nothing

-> m (Maybe Color)

Returns: the newly allocated Color, which should be freed with colorFree, or Nothing if src was Nothing.

Creates a copy of src, which 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 Color, may be Nothing

-> m () 

Frees a color allocated by colorCopy.

parse

colorParse Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color structure in which to store the result, or Nothing

-> 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 <ulink url="http://dev.w3.org/csswg/css-color/named-colors">specification</ulink>), or it can be a hexadecimal value in the form '&num;rgb' '&num;rrggbb' '&num;rrrgggbbb' or '&num;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 '&num;fff' '&num;ffffff' '&num;fffffffff' and '&num;ffffffffffff')

toString

colorToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Color

color: a Color

-> m Text

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

Returns a textual specification of color in the hexadecimal form <literal>&num;rrrrggggbbbb</literal>, where <literal>r</literal>, <literal>g</literal> and <literal>b</literal> 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 ]