Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_color.hh
| Show All 28 Lines | |||||
| * Will increase readability and visibility of typical mistakes when | * Will increase readability and visibility of typical mistakes when | ||||
| * working with colors. | * working with colors. | ||||
| * | * | ||||
| * The storage structs can hold 4 channels (r, g, b and a). | * The storage structs can hold 4 channels (r, g, b and a). | ||||
| * | * | ||||
| * Usage: | * Usage: | ||||
| * | * | ||||
| * Convert a theme byte color to a linearrgb premultiplied. | * Convert a theme byte color to a linearrgb premultiplied. | ||||
| * ``` | * \code{.cc} | ||||
| * ColorTheme4b theme_color; | * ColorTheme4b theme_color; | ||||
| * ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color = | * ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color = | ||||
| * BLI_color_convert_to_scene_linear(theme_color).premultiply_alpha(); | * BLI_color_convert_to_scene_linear(theme_color).premultiply_alpha(); | ||||
| * ``` | * \endcode | ||||
| * | * | ||||
| * The API is structured to make most use of inlining. Most notable are space | * The API is structured to make most use of inlining. Most notable are space | ||||
| * conversions done via `BLI_color_convert_to*` functions. | * conversions done via `BLI_color_convert_to*` functions. | ||||
| * | * | ||||
| * - Conversions between spaces (theme <=> scene linear) should always be done by | * - Conversions between spaces (theme <=> scene linear) should always be done by | ||||
| * invoking the `BLI_color_convert_to*` methods. | * invoking the `BLI_color_convert_to*` methods. | ||||
| * - Encoding colors (compressing to store colors inside a less precision storage) | * - Encoding colors (compressing to store colors inside a less precision storage) | ||||
| * should be done by invoking the `encode` and `decode` methods. | * should be done by invoking the `encode` and `decode` methods. | ||||
| ▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines | |||||