Skip to main content

Function: getShadedRgb()

getShadedRgb(rgb, point, unitNormal, lightSource): Rgb

Defined in: src/utils/ManimColor.ts:421

Add light or shadow to an rgb color on a surface, ported from ManimCE's get_shaded_rgb.

The surface sits at point, faces unitNormal, and may be lit by lightSource. The result is not clamped, matching ManimCE.

Parameters​

rgb​

Rgb

The surface base color (0.0..1.0 floats).

point​

readonly number[]

The location of the surface.

unitNormal​

readonly number[]

The unit normal the surface faces.

lightSource​

readonly number[]

The location of the light source.

Returns​

Rgb