简体   繁体   中英

How to convert Int to hex string?

Is it possible to convert integer to 6 digit hex code? In AS3 I had native API

var color:uint = 0xFF00FF;
trace("Color #" + color.toString(16)); //Color #ff00ff

Does Haxe have such functionality in standard library?

您可以使用StringTools.hex() http://api.haxe.org/StringTools.html#hex

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM