Incorrect color using make_color_hsv

Right now, i'm trying to build a game with only a four color palette.

Im trying to draw my health bar with this specific color:
GML:
col01 = make_color_hsv(7,85,81)
draw_healthbar(162,79,338,109,25*oPlayer.pHealth,col01,col01,col01,0,false,false)
This is how color looks like in Aseprite:
1621342101071.png

This is how it looks in my game:
1621342174956.png

I don't know why it is happening :/
I remember using this function before and never had those problems.

I need some help guys.
 

muki

Member
Aseprite operates with values from 0-100. make_color_hsv operates with 0-255. All you have to do is scale your values.

Likewise, Photoshop's hue wheel is 0-359. Something to look out for.

As a sidenote, I wish gamemaker had the equivalent of a make_color_hex. It would make copying/pasting color values between applications much easier and without errors. (when all you need is fixed colors and no lum/sat control over them, anyway)
 
Last edited:

FrostyCat

Member
Aseprite operates with values from 0-100. make_color_hsv operates with 0-255. All you have to do is scale your values.

Likewise, Photoshop's hue wheel is 0-359. Something to look out for.

As a sidenote, I wish gamemaker had the equivalent of a make_color_hex. It would make copying/pasting color values between applications much easier and without errors. (when all you need is fixed colors and no lum/sat control over them, anyway)
GML:
function make_color_hex(rgb) {
    gml_pragma("forceinline");
    return ((rgb >> 16) & $FF) | (rgb & $FF00) | ((rgb & $FF) << 16);
}
GML:
col = make_color_hex($cf331e);
 

O.Stogden

Member
Aseprite operates with values from 0-100. make_color_hsv operates with 0-255. All you have to do is scale your values.

Likewise, Photoshop's hue wheel is 0-359. Something to look out for.

As a sidenote, I wish gamemaker had the equivalent of a make_color_hex. It would make copying/pasting color values between applications much easier and without errors. (when all you need is fixed colors and no lum/sat control over them, anyway)
GMS has built in hex support: https://manual.yoyogames.com/#t=Gam...lour_And_Alpha/Colour_And_Alpha.htm&ux=search

You just use the $ symbol and then the 6 hex values after.
 

chirpy

Member
Aseprite operates with values from 0-100. make_color_hsv operates with 0-255. All you have to do is scale your values.

Likewise, Photoshop's hue wheel is 0-359. Something to look out for.
Fun fact:
GMS2's color picker has a hue range of 130-230, saturation and value operate with 0-100. Also something to look out for.


Code:
function make_color_hsv_gms2(_hue,_sat,_val)
{   // terribly wrong
    //var hue = 255*((_hue-130)/100);
    var hue = 255*(_hue/360);
    var saturation = 255*(_sat/100);
    var value = 255*(_val/100);
    return make_colour_hsv(hue,saturation,value);
}
 
Last edited:

chirpy

Member
Fun fact:
GMS2's color picker has a hue range of 130-230, saturation and value operate with 0-100. Also something to look out for.

Code:
function make_color_hsv_gms2(_hue,_sat,_val)
{
    var hue = 255*((_hue-130)/100);
    var saturation = 255*(_sat/100);
    var value = 255*(_val/100);
    return make_colour_hsv(hue,saturation,value);
}
Uh, I only realized just now that I was terribly wrong about this. Hue ranges from 0-360, I was only looking at some color whose hue was around 180, so GMS showed neighboring colors ranging from 130-230.
 
Top