fresnel.color#
Overview
Convert a sRGB color (or colors) into the linear space. |
Details
Color utilities.
- fresnel.color.linear(color)#
Convert a sRGB color (or colors) 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 ((3, ), (4, ), (N, 3), or (N, 4)
numpy.ndarray
ofnumpy.float32
) –RGB
orRGBA
colors.
Color components are in the range [0,1].
- Returns:
numpy.ndarray
with the linearized color(s), same shape ascolor
.