colorToHexString

Turn GameMaker colors into hex strings as used in many graphics editing programs and commonly used in web styling.

For example:

color_to_hex_string( c_red , 0 );

Will return the string:

“#FF0000”

You can also set the second argument to 1 to return a BGR string instead of an RGB string.

Free on GameMaker: Marketplace

Written by Dan

Managing Director and mobile development whizz.