summaryrefslogtreecommitdiff
path: root/libs/cglm/docs/source/color.rst
blob: 62a4dc1afa6bf0fb4575091be1f738c7e3b233b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.. default-domain:: C

color
================================================================================

Header: cglm/color.h

Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Functions:

1. :c:func:`glm_luminance`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: float  glm_luminance(vec3 rgb)

    | averages the color channels into one value

    This function uses formula in COLLADA 1.5 spec which is

    .. code-block:: text

       luminance = (color.r * 0.212671) +
                   (color.g * 0.715160) +
                   (color.b * 0.072169)

    It is based on the ISO/CIE color standards (see ITU-R Recommendation BT.709-4),
    that averages the color channels into one value

    Parameters:
      | *[in]*  **rgb**   RGB color