Class ColorState
- All Implemented Interfaces:
Proxy
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.
- Since:
- 4.16
-
Constructor Summary
ConstructorsConstructorDescriptionColorState(MemorySegment address) Create a ColorState proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescription@Nullable CicpParamsCreate aCicpParamsrepresenting the colorstate.booleanequal(ColorState other) Compares twoGdkColorStatesfor equality.booleanequivalent(ColorState other) Compares twoGdkColorStatesfor equivalence.static ColorStategetOklab()Returns the color state object representing the oklab color space.static ColorStategetOklch()Returns the color state object representing the oklch color space.static ColorStateReturns the color state object representing the linear rec2100 color space.static ColorStateReturns the color state object representing the rec2100-pq color space.static ColorStategetSrgb()Returns the color state object representing the sRGB color space.static ColorStateReturns the color state object representing the linearized sRGB color space.static @Nullable TypegetType()Get the GType of the ColorState classref()Increase the reference count ofself.voidunref()Decrease the reference count ofself.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ColorState
Create a ColorState proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
getOklab
Returns the color state object representing the oklab color space.This is a perceptually uniform color state.
- Returns:
- the color state object for oklab
- Since:
- 4.18
-
getOklch
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.
- Returns:
- the color state object for oklch
- Since:
- 4.18
-
getRec2100Linear
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.
- Returns:
- the color state object for linearized rec2100
- Since:
- 4.16
-
getRec2100Pq
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.
- Returns:
- the color state object for rec2100-pq
- Since:
- 4.16
-
getSrgb
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.
- Returns:
- the color state object for sRGB
- Since:
- 4.16
-
getSrgbLinear
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.
- Returns:
- the color state object for linearized sRGB
- Since:
- 4.16
-
createCicpParams
Create aCicpParamsrepresenting the colorstate.It is not guaranteed that every
GdkColorStatecan be represented with Cicp parameters. If that is the case, this function returnsNULL.- Returns:
- A new
CicpParams - Since:
- 4.16
-
equal
Compares twoGdkColorStatesfor 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.
- Parameters:
other- anotherGdkColorStatee- Returns:
trueif the two color states compare equal- Since:
- 4.16
-
equivalent
Compares twoGdkColorStatesfor equivalence.Two objects that represent the same color state should be equivalent, even though they may not be equal in the sense of
equal(org.gnome.gdk.ColorState).- Parameters:
other- anotherGdkColorStatee- Returns:
trueif the two color states are equivalent- Since:
- 4.20
-
ref
Increase the reference count ofself.- Returns:
- the object that was passed in
- Since:
- 4.16
-
unref
public void unref()Decrease the reference count ofself.Unless this ColorState is static, it will be freed when the reference count reaches zero.
- Since:
- 4.16
-