The ManagedColor class is a class to handle colors that are color managed. A managed color is a color of which we know the model(RGB, LAB, CMYK, etc), the bitdepth and the specific properties of its colorspace, such as the whitepoint, chromaticities, trc, etc, as represented by the color profile.
Krita has two color management systems. LCMS and OCIO. LCMS is the one handling the ICC profile stuff, and the major one handling that ManagedColor deals with. OCIO support is only in the display of the colors. ManagedColor has some support for it in colorForCanvas()
All colors in Krita are color managed. QColors are understood as RGB-type colors in the sRGB space.
We recommend you make a color like this:
Static methods
Methods
Member documentation
create a managed color with the given color space properties.
Parameters
colorModel | (no description provided) |
colorDepth | (no description provided) |
colorProfile | (no description provided) |
parent | (no description provided) |
Return
(no description provided) |
colorDepth A string describing the color depth of the image:
- U8: unsigned 8 bits integer, the most common type
- U16: unsigned 16 bits integer
- F16: half, 16 bits floating point. Only available if Krita was built with OpenEXR
- F32: 32 bits floating point
Return
the color depth. |
Parameters
canvas | the canvas whose color management you'd like to use. In Krita, different views have separate canvasses, and these can have different OCIO configurations active. |
Return
the QColor as it would be displaying on the canvas. This result can be used to draw widgets with the correct configuration applied. |
retrieve the current color model of this document:
- A: Alpha mask
- RGBA: RGB with alpha channel (The actual order of channels is most often BGR!)
- XYZA: XYZ with alpha channel
- LABA: LAB with alpha channel
- CMYKA: CMYK with alpha channel
- GRAYA: Gray with alpha channel
- YCbCrA: YCbCr with alpha channel
Return
the internal color model string. |
Return
a QVector containing the channel/components of this color normalized. This includes the alphachannel. |
componentsOrdered()
Return
same as Components, except the values are ordered to the display. |
is the (approximate) reverse of colorForCanvas()
Parameters
qcolor | the QColor to convert to a KoColor. |
canvas | the canvas whose color management you'd like to use. |
Return
the approximated ManagedColor, to use for canvas resources. |
Unserialize a color following Create's swatch color specification available at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
Parameters
xml | an XML color |
Return
the unserialized color, or an empty color object if the function failed to unserialize the color |
set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted.
Parameters
colorProfile | (no description provided) |
Return
false if the colorProfile name does not correspond to to a registered profile or if assigning the profile failed. |
convert the nodes and the image to the given colorspace. The conversion is done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint compensation.
Parameters
colorModel | A string describing the color model of the image:
|
colorDepth | A string describing the color depth of the image:
|
colorProfile | a valid color profile for this color model and color depth combination. |
Return
false the combination of these arguments does not correspond to a colorspace. |
Set the channel/components with normalized values. For integer colorspace, this obviously means the limit is between 0.0-1.0, but for floating point colorspaces, 2.4 or 103.5 are still meaningful (if bright) values.
Parameters
values | the QVector containing the new channel/component values. These should be normalized. |
create a user-visible string of the channel names and the channel values
Return
a string that can be used to display the values of this color to the user. |
Serialize this color following Create's swatch color specification available at https://web.archive.org/web/20110826002520/http://create.freedesktop.org/wiki/Swatches_-_color_file_format/Draft
Return
(no description provided) |