3.1 <GdkColorState>

Structure: <GdkColorState>

Provides information to interpret colors and pixels in a variety of ways.

They are also known as *color spaces*.

Crucially, GTK knows how to convert colors from one color state to another.

<GdkColorState> objects are immutable and therefore threadsafe.

Procedures

Method: color-state:create-cicp-params self ⇒ %return
Method: create-cicp-params self ⇒ %return

Create a <GdkCicpParams> representing the colorstate.

It is not guaranteed that every <GdkColorState> can be represented with Cicp parameters. If that is the case, this function returns NULL.

self

Passed: a <GdkColorState>.

a <GdkColorState>

%return

Returned: a <GdkCicpParams>, or #f.

A new <GdkCicpParams>

Method: color-state:equal? self other ⇒ %return
Method: equal? self other ⇒ %return

Compares two GdkColorStates for equality.

Note that this function is not guaranteed to be perfect and two objects describing the same color state may compare not equal. However, different color states will never compare equal.

self

Passed: a <GdkColorState>.

a <GdkColorState>

other

Passed: a <GdkColorState>.

another GdkColorStatee

%return

Returned: a boolean.

#t if the two color states compare equal

Method: color-state:equivalent? self other ⇒ %return
Method: equivalent? self other ⇒ %return

Compares two GdkColorStates for equivalence.

Two objects that represent the same color state should be equivalent, even though they may not be equal in the sense of color-state:equal?.

self

Passed: a <GdkColorState>.

a <GdkColorState>

other

Passed: a <GdkColorState>.

another GdkColorStatee

%return

Returned: a boolean.

#t if the two color states are equivalent

Procedure: color-state:get-oklab ⇒ %return

Returns the color state object representing the oklab color space.

This is a perceptually uniform color state.

%return

Returned: a <GdkColorState>.

the color state object for oklab

Procedure: color-state:get-oklch ⇒ %return

Returns the color state object representing the oklch color space.

This is the polar variant of oklab, in which the hue is encoded as a polar coordinate.

%return

Returned: a <GdkColorState>.

the color state object for oklch

Procedure: color-state:get-rec2100-linear ⇒ %return

Returns the color state object representing the linear rec2100 color space.

This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and a linear transfer function.

It is equivalent to the Cicp tuple 9/8/0/1.

See e.g. the CSS HDR Module for details about this colorstate.

%return

Returned: a <GdkColorState>.

the color state object for linearized rec2100

Procedure: color-state:get-rec2100-pq ⇒ %return

Returns the color state object representing the rec2100-pq color space.

This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and the transfer function defined by SMPTE ST 2084 and BT.2100-2.

It is equivalent to the Cicp tuple 9/16/0/1.

See e.g. the CSS HDR Module for details about this colorstate.

%return

Returned: a <GdkColorState>.

the color state object for rec2100-pq

Procedure: color-state:get-srgb ⇒ %return

Returns the color state object representing the sRGB color space.

This color state uses the primaries defined by BT.709-6 and the transfer function defined by IEC 61966-2-1.

It is equivalent to the Cicp tuple 1/13/0/1.

See e.g. the CSS Color Module for details about this colorstate.

%return

Returned: a <GdkColorState>.

the color state object for sRGB

Procedure: color-state:get-srgb-linear ⇒ %return

Returns the color state object representing the linearized sRGB color space.

This color state uses the primaries defined by BT.709-6 and a linear transfer function.

It is equivalent to the Cicp tuple 1/8/0/1.

See e.g. the CSS Color Module for details about this colorstate.

%return

Returned: a <GdkColorState>.

the color state object for linearized sRGB

Method: color-state:ref self ⇒ %return
Method: ref self ⇒ %return

Increase the reference count of self.

self

Passed: a <GdkColorState>.

a <GdkColorState>

%return

Returned: a <GdkColorState>.

the object that was passed in

Method: color-state:unref self
Method: unref self

Decrease the reference count of self.

Unless self is static, it will be freed when the reference count reaches zero.

self

Passed: a <GdkColorState>.

a <GdkColorState>