Build the matrix for ~R/~G/~B(percent): scales one or more channels by a percentage (100 = unchanged), leaving any channel not passed at 100%.
~R
~G
~B(percent)
import { channelScaleMatrix } from '@datamoc/mw_games/two-d/render';const matrix = channelScaleMatrix({ red: 150 }); // ~R(150), a 50% brighter red channelconsole.log(matrix[0]); // 1.5 Copy
import { channelScaleMatrix } from '@datamoc/mw_games/two-d/render';const matrix = channelScaleMatrix({ red: 150 }); // ~R(150), a 50% brighter red channelconsole.log(matrix[0]); // 1.5
Build the matrix for
~R/~G/~B(percent): scales one or more channels by a percentage (100 = unchanged), leaving any channel not passed at 100%.