[client] added draw package

This commit is contained in:
2018-02-08 17:57:40 +03:00
parent 89ac9fd225
commit dd1014e230
3 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
package ru.m.draw;
import flash.geom.ColorTransform;
import flash.geom.Rectangle;
import flash.display.BitmapData;
class BitmapUtil {
public static function colorize(data: BitmapData, color: Color):BitmapData {
var result = data.clone();
var transform = new ColorTransform(1, 1, 1, 1, color.red, color.green, color.blue, color.alpha);
result.colorTransform(new Rectangle(0, 0, result.width, result.height), transform);
return result;
}
}