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.Gdk.Structs.ColorState
Description
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.
Since: 4.16
Synopsis
- newtype ColorState = ColorState (ManagedPtr ColorState)
- colorStateCreateCicpParams :: (HasCallStack, MonadIO m) => ColorState -> m (Maybe CicpParams)
- colorStateEqual :: (HasCallStack, MonadIO m) => ColorState -> ColorState -> m Bool
- colorStateEquivalent :: (HasCallStack, MonadIO m) => ColorState -> ColorState -> m Bool
- colorStateGetOklab :: (HasCallStack, MonadIO m) => m ColorState
- colorStateGetOklch :: (HasCallStack, MonadIO m) => m ColorState
- colorStateGetRec2100Linear :: (HasCallStack, MonadIO m) => m ColorState
- colorStateGetRec2100Pq :: (HasCallStack, MonadIO m) => m ColorState
- colorStateGetSrgb :: (HasCallStack, MonadIO m) => m ColorState
- colorStateGetSrgbLinear :: (HasCallStack, MonadIO m) => m ColorState
- colorStateRef :: (HasCallStack, MonadIO m) => ColorState -> m ColorState
- colorStateUnref :: (HasCallStack, MonadIO m) => ColorState -> m ()
Exported types
newtype ColorState Source #
Memory-managed wrapper type.
Constructors
ColorState (ManagedPtr ColorState) |
Instances
Eq ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState | |
GBoxed ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState | |
ManagedPtrNewtype ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState Methods | |
TypedObject ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState | |
HasParentTypes ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState | |
IsGValue (Maybe ColorState) Source # | Convert |
Defined in GI.Gdk.Structs.ColorState Methods gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe ColorState -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe ColorState) # | |
type ParentTypes ColorState Source # | |
Defined in GI.Gdk.Structs.ColorState type ParentTypes ColorState = '[] :: [Type] |
Methods
Click to display all available methods, including inherited ones
createCicpParams
colorStateCreateCicpParams Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> ColorState |
|
-> m (Maybe CicpParams) | Returns: A new |
Create a CicpParams
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
.
Since: 4.16
equal
Arguments
:: (HasCallStack, MonadIO m) | |
=> ColorState |
|
-> ColorState |
|
-> m Bool | Returns: |
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.
Since: 4.16
equivalent
Arguments
:: (HasCallStack, MonadIO m) | |
=> ColorState |
|
-> ColorState |
|
-> m Bool | Returns: |
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 colorStateEqual
.
Since: 4.20
getOklab
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for oklab |
Returns the color state object representing the oklab color space.
This is a perceptually uniform color state.
Since: 4.18
getOklch
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for oklch |
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.
Since: 4.18
getRec2100Linear
colorStateGetRec2100Linear Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for linearized rec2100 |
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.
Since: 4.16
getRec2100Pq
colorStateGetRec2100Pq Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for rec2100-pq |
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.
Since: 4.16
getSrgb
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for sRGB |
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.
Since: 4.16
getSrgbLinear
colorStateGetSrgbLinear Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ColorState | Returns: the color state object for linearized sRGB |
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.
Since: 4.16
ref
Arguments
:: (HasCallStack, MonadIO m) | |
=> ColorState |
|
-> m ColorState | Returns: the object that was passed in |
Increase the reference count of self
.
Since: 4.16
unref
Arguments
:: (HasCallStack, MonadIO m) | |
=> ColorState |
|
-> m () |
Decrease the reference count of self
.
Unless self
is static, it will be freed
when the reference count reaches zero.
Since: 4.16