Page MenuHomePhabricator

colors.rst
ActivePublic

Authored by mahussain on Feb 29 2020, 12:27 PM.
.. _colors:
Colors
################################
.. _colors_types:
Types Of Colors
================================
Color can handle multiple color formats. Each color format is defined by a
separate class. Presently, Anari can handle the following color formats.
- CMYK
- Hex
- RGBA
- RGBA Float
.. _colors_types_rgba:
RGBA
--------------------------------
:abbr:`RGBA (red-green-blue-alpha)` colors are specified with the constructor
:code:`RGBA()`, passing the red, green, blue, and alpha values to the
constructor as integers:
.. code-block:: c++
int red = 10;
int green = 50;
int blue = 90;
int alpha = 255;
RGBA mycolor = RGBA(blue, green, blue, alpha);
The RGBA object can be used by itself to represent a constant RGBA color.
However, it's most commonly used when defining or changing a :code:`Color`
value.