In Game Maker, and I imagine other engines, one can "make colour" by defining either the red-green-blue values of the colour or its hue-value-saturation.

I want to create a program that can compare how similar two given colours are, but without built-in functions that detects the "components" (red-value, saturation etc.) of colours, this is kind of hard.

So, I am asking what data type (compound? integer? real number?) is a colour represented in Game Maker and how I can compare them.


Colours in GameMaker is just integers in format $BBGGRR. Some examples:

draw_set_colour($FFFFFF); // white
draw_set_colour($0000FF); // red
draw_set_colour($FF0000); // blue

Also you can use next functons for get components:


See documentation for details.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.