0
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

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:

colour_get_red
colour_get_green
colour_get_blue
colour_get_hue
colour_get_saturation
colour_get_value

See documentation for details.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .