Files
esengine/source/src/Utils/DrawUtils.ts

18 lines
612 B
TypeScript
Raw Normal View History

2020-07-23 11:00:46 +08:00
module es {
/** 各种辅助方法来辅助绘图 */
export class DrawUtils {
2020-07-28 16:25:20 +08:00
public static getColorMatrix(color: number): egret.ColorMatrixFilter {
2020-07-23 11:00:46 +08:00
let colorMatrix = [
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0
];
colorMatrix[0] = Math.floor(color / 256 / 256) / 255;
colorMatrix[6] = Math.floor(color / 256 % 256) / 255;
colorMatrix[12] = color % 256 / 255;
return new egret.ColorMatrixFilter(colorMatrix);
}
}
2020-07-23 11:00:46 +08:00
}