fresnel.color¶
Overview
Convert a sRGB color (or array of such colors) from the gamma corrected color space into the linear space. |
Details
Color utilities.
-
fresnel.color.
linear
(color)¶ Convert a sRGB color (or array of such colors) from the gamma corrected color space into the linear space.
Standard tools for working with sRGB colors provide gamma corrected values. fresnel needs to perform calculations in a linear color space. This method converts from sRGB to the linear space. Use
linear()
when specifying material or particle colors with sRGB inputs (such as you find in a color picker).linear()
accepts RGBA input (such as from matplotlib’s colors.to_rgba colormap method), but ignores the alpha channel and outputs anNx3
array.- Parameters
color (
numpy.ndarray
orarray_like
) – (3
,4
,Nx3
, orNx4
:float32
) -RGB
orRGBA
color in the range [0,1].- Returns
numpy.ndarray
with the linearized color(s), same shape ascolor
.