@phaserjs/phaser
Version:
27 lines (26 loc) • 411 B
JavaScript
import { DEFAULT_COLOR_OFFSET } from "./const";
import { SetColorMatrix } from "./SetColorMatrix";
const values = [
0,
0,
1,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
0,
0,
1
];
export function ShiftToBGR(gameObject, multiply = false) {
if (SetColorMatrix(gameObject.id, values, DEFAULT_COLOR_OFFSET, multiply)) {
gameObject.color.colorMatrixEnabled = true;
}
return gameObject;
}