([r, g, b]: [number, number, number], matrix: Matrix5x5)
| 24 | } |
| 25 | |
| 26 | export function applyColorMatrix([r, g, b]: [number, number, number], matrix: Matrix5x5): [number, number, number] { |
| 27 | const rgb: Matrix5x1 = [[r / 255], [g / 255], [b / 255], [1], [1]]; |
| 28 | const result = multiplyMatrices<Matrix5x1>(matrix, rgb); |
| 29 | return [0, 1, 2].map((i) => clamp(Math.round(result[i][0] * 255), 0, 255)) as [number, number, number]; |
| 30 | } |
| 31 | |
| 32 | export const Matrix = { |
| 33 |
no test coverage detected