• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML How do I make custom text color?

Dr_Nomz

Member
c_color is a great and useful thing, but what if I want like brown or something? (Would love to just pick the main color from a sprite so I can REALLY get creative if that's possible)
 
C

CreatorAtNight

Guest
You can do:
Code:
yourColor = make_color_rgb(red,green,blue)
where red, green and blue are values from 0 to 255.
 

TheouAegis

Member
Or just type it in manually in BGR24.

draw_set_color($2063A0)

which is just a faster version of

draw_set_color(make_color_rgb($A0,$63,$20))

As for finding the main color in a sprite, I'd draw the sprite to a surface, save the surface to a buffer, then loop through the buffer adding each non-zero color it finds to 2D array or ds_priority, increasing the color count if it's already been found at least once, then destroy the buffer, free the surface, and get color with the highest count from the array/queue.
 
C

CreatorAtNight

Guest
Nice, I didn't even know you could just use HEX values like that. That makes things easy. There is always something new to learn! :D Thanks!

EDIT: Oh wait, you say BGR24, I don't even know what that is. Going to look into that.
 
Top