| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Pango.Structs.Color
Description
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
- colorCopy :: (HasCallStack, MonadIO m) => Color -> m (Maybe Color)
- colorFree :: (HasCallStack, MonadIO m) => Color -> m ()
- colorParse :: (HasCallStack, MonadIO m) => Color -> Text -> m Bool
- colorParseWithAlpha :: (HasCallStack, MonadIO m) => Color -> Text -> m (Bool, Word16)
- 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
| Eq Color Source # | |
| GBoxed Color Source # | |
Defined in GI.Pango.Structs.Color | |
| ManagedPtrNewtype Color Source # | |
Defined in GI.Pango.Structs.Color Methods toManagedPtr :: Color -> ManagedPtr Color | |
| TypedObject Color Source # | |
Defined in GI.Pango.Structs.Color | |
| HasParentTypes Color Source # | |
Defined in GI.Pango.Structs.Color | |
| tag ~ 'AttrSet => Constructible Color tag Source # | |
| IsGValue (Maybe Color) Source # | Convert |
Defined in GI.Pango.Structs.Color Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Color -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Color) | |
| type ParentTypes Color Source # | |
Defined in GI.Pango.Structs.Color | |
Methods
Click to display all available methods, including inherited ones
copy
Arguments
| :: (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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color | |
| -> m () |
Frees a color allocated by colorCopy.
parse
Arguments
| :: (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')
parseWithAlpha
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> Text |
|
| -> m (Bool, Word16) | 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')
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
Arguments
| :: (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
setcolor [ #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
setcolor [ #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
setcolor [ #red:=value ]