Reference getFinalColor()

getFinalColor()

Registers a callback to change the final color of each pixel after all lighting and mixing is done in the fragment shader. This hook can be used inside baseColorShader().modify() and similar shader modify() calls to adjust the color before it appears on the screen. The callback receives a four component vector representing red, green, blue, and alpha.

Return a new color array to change the output color.

This hook is available in:

Examples

Syntax

getFinalColor(callback)

Parameters

callback
Function: A callback function which receives the color array and should return a color array.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/p5.strands.js and open a pull request!

Related References