SOLVED Understanding value of c_color when drawing

Xer0botXer0

Senpai
Good day!

Example code:

draw_circle_colour(room_width/2,room_height/2,100,c_white,c_white,0);

According to the manual, the colors have constants here white is "c_white" and they also have values, c_whites' value being "16777215"..

How do I go about incrementing/decrementing that value to arrive at a different color ?
I assume these values aren't just random..

But it's odd since reds' value is "255"..

I'm wondering perhaps it works like this ..

R : 255
G : 0
B : 0
for Red

and

R : 167
G : 772
B : 15

for white.. although that's a weird value for white..

any ideas ?
 

TsukaYuriko

šŸŒ 
Forum Staff
Moderator
Colors are stored in hexadecimal format in BGR order - 0000FF for red, FFFFFF for white. What you're seeing is their decimal representation.

You can use the make_color_* functions to create new colors and the color_get_* functions to retrieve properties of existing colors.
 

TheouAegis

Member
draw_circle_colour(room_width/2,room_height/2,100,c_white,c_white,0);
Consider drawing in yellow. You could use c_yellow, or $00FFFF, or make_colour_rgb(255,255,0) depending on which is easier for you. Obviously the constants are the least flexible, and make_colour_rgb is slower than the other methods, but it's generally easier to work with. And since you have the option of using make_colour_hsv if you prefer to tweak hue, saturation, and brightness, most people's brains will probably veer toward relying on make_colour_ functions for their flexibility.
 
Top