color.rst 836 B

12345678910111213141516171819202122232425262728293031323334
  1. .. default-domain:: C
  2. color
  3. ================================================================================
  4. Header: cglm/color.h
  5. Table of contents (click to go):
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. Functions:
  8. 1. :c:func:`glm_luminance`
  9. Functions documentation
  10. ~~~~~~~~~~~~~~~~~~~~~~~
  11. .. c:function:: float glm_luminance(vec3 rgb)
  12. | averages the color channels into one value
  13. This function uses formula in COLLADA 1.5 spec which is
  14. .. code-block:: text
  15. luminance = (color.r * 0.212671) +
  16. (color.g * 0.715160) +
  17. (color.b * 0.072169)
  18. It is based on the ISO/CIE color standards (see ITU-R Recommendation BT.709-4),
  19. that averages the color channels into one value
  20. Parameters:
  21. | *[in]* **rgb** RGB color