gi-pango-1.0.15: Pango bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
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 #

Constructors

Color (ManagedPtr Color) 

Instances

newZeroColor :: MonadIO m => m Color Source #

Construct a Color struct initialized to zero.

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

green

red

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