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 RGB colors provide gamma corrected values. fresnel needs to perform calculations in a linear color space. This method converts a sRGB into that linear space. Use linear() when specifying material or particle colors with sRGB inputs.

linear() accepts RGBA input (such as from matplotlib’s to_rgba colormap method), but ignores the alpha channel and outputs an Nx3 array.

Parameters:color (tuple) – 3-length (or Nx3, or Nx4) list, or other object convertible to a numpy array (in the range 0-1).
Returns:A numpy array with the linearized color.