SymbolicColorProtocol

public protocol SymbolicColorProtocol

GtkSymbolicColor is a boxed type that represents a symbolic color. It is the result of parsing a color expression. To obtain the color represented by a GtkSymbolicColor, it has to be resolved with gtk_symbolic_color_resolve(), 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 GdkRGBA value.

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

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

The SymbolicColorProtocol protocol exposes the methods and properties of an underlying GtkSymbolicColor instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see SymbolicColor. Alternatively, use SymbolicColorRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkSymbolicColor instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • symbolic_color_ptr Default implementation

    Typed pointer to the underlying GtkSymbolicColor instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkSymbolicColor instance.

    Declaration

    Swift

    var symbolic_color_ptr: UnsafeMutablePointer<GtkSymbolicColor>! { get }
  • Required Initialiser for types conforming to SymbolicColorProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

SymbolicColor Record: SymbolicColorProtocol extension (methods and fields)

  • ref() Extension method

    Increases the reference count of color

    ref is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @discardableResult
    @inlinable
    func ref() -> SymbolicColorRef!
  • If color is resolvable, resolved_color 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 nil, resolving of named colors will fail, so if your color is or references such a color, this function will return false.

    resolve is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func resolve<RGBAT>(props: StylePropertiesRef? = nil, resolvedColor: RGBAT) -> Bool where RGBAT : RGBAProtocol
  • If color is resolvable, resolved_color 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 nil, resolving of named colors will fail, so if your color is or references such a color, this function will return false.

    resolve is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func resolve<RGBAT, StylePropertiesT>(props: StylePropertiesT?, resolvedColor: RGBAT) -> Bool where RGBAT : RGBAProtocol, StylePropertiesT : StylePropertiesProtocol
  • toString() Extension method

    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.

    to_string is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func toString() -> String!
  • unref() Extension method

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

    unref is deprecated:

    GtkSymbolicColor is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func unref()