I’ve been having some trouble getting colorTransform properties to show up properly when drawing an object into BitmapData in HTML. Is this a known issue, or maybe I’m doing something wrong?
Here’s an example:
var sourceData = new BitmapData(100,100); var source = new Bitmap(sourceData); var tx = new openfl.geom.ColorTransform(); tx.color = 0xFF0000; source.transform.colorTransform = tx; addChild(source); var destData = new BitmapData(100,100); destData.draw(source); var dest = new Bitmap(destData); dest.x = 100; addChild(dest);
Which I would expect to display two red squares, side by side. The square filled using draw() shows up as black, however:
It appears that the square being black may be related to the colorTransform r/g/b multipliers being set to 0 somehow? I noticed that if any of them are non-zero then that channel seems to end up being set to 0xFF instead of 0x0 - e.g., if I set tx.greenMultiplier to any non-zero value, then the destination square ends up displayed as 0x00FF00.