Karlstens
Member
I'm working to gain an understanding of how colours work within GMS2.3+ through draw_*shape*_colour() commands to figure colours out. I think my below sample code shows what I'm doing, and perhaps why I'm finding the results confusing - in that, I would expect both the the final shape in the for-loop (which looks correct) to also be the result of a simple rectangle, but instead I just get one colour of red...
Here I'm exploring Hue, Saturation and Value (HSV) - which is super cool!!! But my current point of confusion is with how a coloured shape renders.
GameMaker manual reads for colour shapes;
If it is filled you can define the individual colours for each corner point and if these colours are not the same, you will get a gradient effect from one to the other (the colour settings will over-ride the base colour set with the function draw_set_colour).
But as per my example above, this isn't working for hsv, and I'd like to know why.
Further to this, I plan to continue updating this thread as I progress through colour theory and practice, such as tricks for dealing with the various RGB, RGBA, BGR, ABGR and other rainbow coloured landmines that I expect to step onto through this venture.
Also, if anyone knows any cool and handy tips and tricks for colours, feel free to post them here too.
Here I'm exploring Hue, Saturation and Value (HSV) - which is super cool!!! But my current point of confusion is with how a coloured shape renders.
Code:
// Draws a colour spectrum, cool! That's what I expected...
for ( var _i=0; _i < 255; _i++;) {
draw_rectangle_colour(_i,0,_i,80,make_colour_hsv(_i,255,255),make_colour_hsv(_i,255,255),make_colour_hsv(_i,255,255),make_colour_hsv(_i,255,255),false);
};
//Doesn't draw a colour spectrum... but I would thing that it should, because the hue is spanning from 0 to 255, from left to right?
draw_rectangle_colour(0,80,255,160,make_colour_hsv(0,255,255),make_colour_hsv(255,255,255),make_colour_hsv(255,255,255),make_colour_hsv(0,255,255),false);
If it is filled you can define the individual colours for each corner point and if these colours are not the same, you will get a gradient effect from one to the other (the colour settings will over-ride the base colour set with the function draw_set_colour).
But as per my example above, this isn't working for hsv, and I'd like to know why.
Further to this, I plan to continue updating this thread as I progress through colour theory and practice, such as tricks for dealing with the various RGB, RGBA, BGR, ABGR and other rainbow coloured landmines that I expect to step onto through this venture.
Also, if anyone knows any cool and handy tips and tricks for colours, feel free to post them here too.
Last edited: