Type conversion to uint

Hello,

I read my app configuration from an json file into a jsonObject. the types inside json are very limited, hex values like 0x00ff00 are not possible. How can I change a string to the hex value in haxe? I tried Std.parseInt, but the stage stays black.

stage.color = 0x0000ff
stage.color = Std.parseInt(“0x00ff00”);

regards

Hi!

A simple test project with this code works fine, at least on the current dev version

openfl create project StageColorTest
cd StageColorTest

Then editing “Source/Main.hx”

package;


import openfl.display.Sprite;


class Main extends Sprite {
	
	
	public function new () {
		
		super ();
		
		stage.color = 0x0000ff;
		stage.color = Std.parseInt("0x00ff00");
		
	}
	
	
}
openfl test neko
openfl test html5

Both desktop and web versions have a green background

you’re right, I should check these things in small projects like you did. that’s so easy in haxe.