Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
The Color
structure is used to
represent a color in an uncalibrated RGB color-space.
Synopsis
- newtype Color = Color (ManagedPtr Color)
- newZeroColor :: MonadIO m => m Color
- noColor :: Maybe Color
- colorCopy :: (HasCallStack, MonadIO m) => Color -> m (Maybe Color)
- colorFree :: (HasCallStack, MonadIO m) => Color -> m ()
- colorParse :: (HasCallStack, MonadIO m) => Color -> Text -> m Bool
- colorToString :: (HasCallStack, MonadIO m) => Color -> m Text
- getColorBlue :: MonadIO m => Color -> m Word16
- setColorBlue :: MonadIO m => Color -> Word16 -> m ()
- getColorGreen :: MonadIO m => Color -> m Word16
- setColorGreen :: MonadIO m => Color -> Word16 -> m ()
- getColorRed :: MonadIO m => Color -> m Word16
- setColorRed :: MonadIO m => Color -> Word16 -> m ()
Exported types
Memory-managed wrapper type.
Instances
BoxedObject Color Source # | |
tag ~ AttrSet => Constructible Color tag Source # | |
Defined in GI.Pango.Structs.Color |
Methods
copy
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> m (Maybe Color) | Returns: the newly allocated |
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
:: (HasCallStack, MonadIO m) | |
=> Color | |
-> m () |
Frees a color allocated by colorCopy
.
parse
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> Text |
|
-> m Bool | Returns: |
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 '#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')
toString
:: (HasCallStack, MonadIO m) | |
=> Color |
|
-> m Text | Returns: a newly-allocated text string that must be freed with |
Returns a textual specification of color
in the hexadecimal form
<literal>#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 ]