| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Gdk.Structs.Color
Description
A Color is used to describe a color,
similar to the XColor struct used in the X11 drawing API.
Synopsis
- newtype Color = Color (ManagedPtr Color)
- newZeroColor :: MonadIO m => m Color
- colorCopy :: (HasCallStack, MonadIO m) => Color -> m Color
- colorEqual :: (HasCallStack, MonadIO m) => Color -> Color -> m Bool
- colorFree :: (HasCallStack, MonadIO m) => Color -> m ()
- colorHash :: (HasCallStack, MonadIO m) => Color -> m Word32
- colorParse :: (HasCallStack, MonadIO m) => Text -> m (Bool, Color)
- 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 ()
- getColorPixel :: MonadIO m => Color -> m Word32
- setColorPixel :: MonadIO m => Color -> Word32 -> 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.Gdk.Structs.Color | |
| ManagedPtrNewtype Color Source # | |
Defined in GI.Gdk.Structs.Color Methods toManagedPtr :: Color -> ManagedPtr Color | |
| TypedObject Color Source # | |
Defined in GI.Gdk.Structs.Color | |
| HasParentTypes Color Source # | |
Defined in GI.Gdk.Structs.Color | |
| tag ~ 'AttrSet => Constructible Color tag Source # | |
| IsGValue (Maybe Color) Source # | Convert |
Defined in GI.Gdk.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.Gdk.Structs.Color | |
Methods
Click to display all available methods, including inherited ones
copy
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> m Color | Returns: a copy of |
equal
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> Color |
|
| -> m Bool | Returns: |
Deprecated: (Since version 3.14)Use RGBA
Compares two colors.
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> m () |
hash
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> m Word32 | Returns: The hash function applied to |
Deprecated: (Since version 3.14)Use RGBA
A hash function suitable for using for a hash
table that stores GdkColors.
parse
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Bool, Color) | Returns: |
Deprecated: (Since version 3.14)Use RGBA
Parses a textual specification of a color and fill in the
red, green, and blue fields of a Color.
The string can either one of a large set of standard names
(taken from the X11 rgb.txt file), 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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Color |
|
| -> m Text | Returns: a newly-allocated text string |
Deprecated: (Since version 3.14)Use RGBA
Returns a textual specification of color in the hexadecimal
form “#rrrrggggbbbb” where “r”, “g” and “b” are hex digits
representing the red, green and blue components respectively.
The returned string can be parsed by colorParse.
Since: 2.12
Properties
blue
The blue component of the color
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
The green component of the color
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 ]
pixel
For allocated colors, the pixel value used to draw this color on the screen. Not used anymore.
getColorPixel :: MonadIO m => Color -> m Word32 Source #
Get the value of the “pixel” field.
When overloading is enabled, this is equivalent to
get color #pixel
setColorPixel :: MonadIO m => Color -> Word32 -> m () Source #
Set the value of the “pixel” field.
When overloading is enabled, this is equivalent to
setcolor [ #pixel:=value ]
red
The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity
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 ]