fresnel.color#

Overview

linear

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 an Nx3 array.

Parameters:

color ((3, ), (4, ), (N, 3), or (N, 4) numpy.ndarray of numpy.float32) – RGB or RGBA colors.

Color components are in the range [0,1].

Returns:

numpy.ndarray with the linearized color(s), same shape as color.