fresnel.color

Overview

fresnel.color.linear

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

Parameters

color (numpy.ndarray or array_like) – (3, 4, Nx3, or Nx4 : float32) - RGB or RGBA color in the range [0,1].

Returns

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