Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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)
- noSymbolicColor :: Maybe 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.
Instances
BoxedObject SymbolicColor Source # | |
Defined in GI.Gtk.Structs.SymbolicColor boxedType :: SymbolicColor -> IO GType # |
noSymbolicColor :: Maybe SymbolicColor Source #
A convenience alias for Nothing
:: Maybe
SymbolicColor
.
Methods
newAlpha
symbolicColorNewAlpha Source #
:: (HasCallStack, MonadIO m) | |
=> SymbolicColor |
|
-> Double |
|
-> m SymbolicColor | Returns: A newly created |
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 #
:: (HasCallStack, MonadIO m) | |
=> RGBA |
|
-> m SymbolicColor | Returns: a newly created |
Deprecated: (Since version 3.8)SymbolicColor
is deprecated.
Creates a symbolic color pointing to a literal color.
Since: 3.0
newMix
:: (HasCallStack, MonadIO m) | |
=> SymbolicColor |
|
-> SymbolicColor |
|
-> Double |
|
-> m SymbolicColor | Returns: A newly created |
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
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m SymbolicColor | Returns: a newly created |
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 #
:: (HasCallStack, MonadIO m) | |
=> SymbolicColor |
|
-> Double |
|
-> m SymbolicColor | Returns: A newly created |
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 #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> m SymbolicColor | Returns: A newly created |
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
:: (HasCallStack, MonadIO m) | |
=> SymbolicColor |
|
-> m SymbolicColor | Returns: the same |
Deprecated: (Since version 3.8)SymbolicColor
is deprecated.
Increases the reference count of color
Since: 3.0
resolve
:: (HasCallStack, MonadIO m, IsStyleProperties a) | |
=> SymbolicColor |
|
-> Maybe a |
|
-> m (Bool, RGBA) | Returns: |
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 #
:: (HasCallStack, MonadIO m) | |
=> SymbolicColor |
|
-> m Text | Returns: a new string representing |
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
:: (HasCallStack, MonadIO m) | |
=> 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