gi-gtk-3.0.43: Gtk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Structs.SymbolicColor

Contents

- Exported types
- Methods
  - newAlpha
  - newLiteral
  - newMix
  - newName
  - newShade
  - newWin32
  - ref
  - resolve
  - toString
  - unref

Description

GtkSymbolicColor is a boxed type that represents a symbolic color. It is the result of parsing a [color expression][gtkcssprovider-symbolic-colors]. To obtain the color represented by a GtkSymbolicColor, it has to be resolved with `symbolicColorResolve`, which replaces all symbolic color references by the colors they refer to (in a given context) and evaluates mix, shade and other expressions, resulting in a `RGBA` value.

It is not normally necessary to deal directly with `GtkSymbolicColors`, since they are mostly used behind the scenes by `StyleContext` and `CssProvider`.

`SymbolicColor` is deprecated. Symbolic colors are considered an implementation detail of GTK+.

Synopsis

- newtype SymbolicColor = SymbolicColor (ManagedPtr SymbolicColor)
- symbolicColorNewAlpha :: (HasCallStack, MonadIO m) => SymbolicColor -> Double -> m SymbolicColor
- symbolicColorNewLiteral :: (HasCallStack, MonadIO m) => RGBA -> m SymbolicColor
- symbolicColorNewMix :: (HasCallStack, MonadIO m) => SymbolicColor -> SymbolicColor -> Double -> m SymbolicColor
- symbolicColorNewName :: (HasCallStack, MonadIO m) => Text -> m SymbolicColor
- symbolicColorNewShade :: (HasCallStack, MonadIO m) => SymbolicColor -> Double -> m SymbolicColor
- symbolicColorNewWin32 :: (HasCallStack, MonadIO m) => Text -> Int32 -> m SymbolicColor
- symbolicColorRef :: (HasCallStack, MonadIO m) => SymbolicColor -> m SymbolicColor
- symbolicColorResolve :: (HasCallStack, MonadIO m, IsStyleProperties a) => SymbolicColor -> Maybe a -> m (Bool, RGBA)
- symbolicColorToString :: (HasCallStack, MonadIO m) => SymbolicColor -> m Text
- symbolicColorUnref :: (HasCallStack, MonadIO m) => SymbolicColor -> m ()

# Exported types

newtype SymbolicColor Source #

Memory-managed wrapper type.

Constructors

SymbolicColor (ManagedPtr SymbolicColor) |

#### Instances

Instances details

Eq SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor Methods (==) :: SymbolicColor -> SymbolicColor -> Bool Source # (/=) :: SymbolicColor -> SymbolicColor -> Bool Source #
GBoxed SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor
ManagedPtrNewtype SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor Methods toManagedPtr :: SymbolicColor -> ManagedPtr SymbolicColor Source #
TypedObject SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor Methods glibType :: IO GType Source #
HasParentTypes SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor
IsGValue (Maybe SymbolicColor) Source # | Convert `SymbolicColor` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.SymbolicColor Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe SymbolicColor -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe SymbolicColor) Source #
type ParentTypes SymbolicColor Source # |
Instance details Defined in GI.Gtk.Structs.SymbolicColor type ParentTypes SymbolicColor = '[] :: [Type]

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

ref, resolve, toString, unref.

#### Getters

None.

#### Setters

None.

## newAlpha

symbolicColorNewAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color`: another `SymbolicColor`
-> Double | `factor`: factor to apply to `color` alpha
-> m SymbolicColor | Returns: A newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color by modifying the relative alpha value of `color`. A factor < 1.0 would resolve to a more transparent color, while > 1.0 would resolve to a more opaque color.

Since: 3.0

## newLiteral

symbolicColorNewLiteral Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RGBA | `color`: a `RGBA`
-> m SymbolicColor | Returns: a newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color pointing to a literal color.

Since: 3.0

## newMix

symbolicColorNewMix Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color1`: color to mix
-> SymbolicColor | `color2`: another color to mix
-> Double | `factor`: mix factor
-> m SymbolicColor | Returns: A newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color defined as a mix of another two colors. a mix factor of 0 would resolve to `color1`, while a factor of 1 would resolve to `color2`.

Since: 3.0

## newName

symbolicColorNewName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `name`: color name
-> m SymbolicColor | Returns: a newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color pointing to an unresolved named color. See `styleContextLookupColor` and `stylePropertiesLookupColor`.

Since: 3.0

## newShade

symbolicColorNewShade Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color`: another `SymbolicColor`
-> Double | `factor`: shading factor to apply to `color`
-> m SymbolicColor | Returns: A newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color defined as a shade of another color. A factor > 1.0 would resolve to a brighter color, while < 1.0 would resolve to a darker color.

Since: 3.0

## newWin32

symbolicColorNewWin32 Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `themeClass`: The theme class to pull color from
-> Int32 | `id`: The color id
-> m SymbolicColor | Returns: A newly created `SymbolicColor`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Creates a symbolic color based on the current win32 theme.

Note that while this call is available on all platforms the actual value returned is not reliable on non-win32 platforms.

Since: 3.4

## ref

symbolicColorRef Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color`: a `SymbolicColor`
-> m SymbolicColor | Returns: the same `color`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Increases the reference count of `color`

Since: 3.0

## resolve

symbolicColorResolve Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleProperties a) |
=> SymbolicColor | `color`: a `SymbolicColor`
-> Maybe a | `props`: `StyleProperties` to use when resolving named colors, or `Nothing`
-> m (Bool, RGBA) | Returns: `True` if the color has been resolved

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

If `color` is resolvable, `resolvedColor` will be filled in with the resolved color, and `True` will be returned. Generally, if `color` can’t be resolved, it is due to it being defined on top of a named color that doesn’t exist in `props`.

When `props` is `Nothing`, resolving of named colors will fail, so if your `color` is or references such a color, this function will return `False`.

Since: 3.0

## toString

symbolicColorToString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color`: color to convert to a string
-> m Text | Returns: a new string representing `color`

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Converts the given `color` to a string representation. This is useful both for debugging and for serialization of strings. The format of the string may change between different versions of GTK, but it is guaranteed that the GTK css parser is able to read the string and create the same symbolic color from it.

## unref

symbolicColorUnref Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> SymbolicColor | `color`: a `SymbolicColor`
-> m () |

Deprecated: (Since version 3.8)`SymbolicColor` is deprecated.

Decreases the reference count of `color`, freeing its memory if the reference count reaches 0.

Since: 3.0