View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0029758||Runner||Functions||Public||2018-07-05 13:45||2018-10-29 14:26|
|Reporter||Stewart Bishop||Assigned To||Alan Savage|
|Priority||Low||Severity||C - General||Reproducibility||100%|
|Target Version||2.2.1||Fixed in Version||2.2.1|
|Summary||0029758: Functions: make_color_hsv) is not producing the same colours as its RGB counter part using the same colour values|
|Description||If you use the GMS2 IDE as a comparison and take the RGB values and HSV values for the same color and make the color in code using make_color_rgb and make_color_hsv then the hsv version will not give you the expected results.|
Using make_color_rgb(255, 135, 84) will give you an orange/peach color whereas make_color_hsv(18, 67, 100) will give you a grey color.
The manual states that the arguments are from 0 to 255 for Hue, Saturation and Value which is not true. Hue goes from 0 to 360, Saturation goes from 0 to 100 and Value goes from 0 to 100 so it seems like this function and manual could use some updating and fixing.
|Steps To Reproduce||1) Run the sample|
2) See the differences
|Tags||No tags attached.|
|1.4 Found In|
|2.x Runtime Found In||126.96.36.199|
|2.x Runtime Verified In||188.8.131.528|
ColorTest.yyz (19,862 bytes)
Whomever that submitted this ticket might of have had slightly lacking understanding of HSV.
The built-in functions definitely take 0..255 range for each component.
hsv(0,255,255) is red.
hsv(127,255,255) is aqua (so the hue isn't 0..360)
hsv(0,100,255) gives you soft red (so the saturation isn't 0..100)
hsv(0,255,100) gives you dark red (so the value isn't 0..100)
However! I found that native implementation casts hue to uint8 so you can't actually cover every possible RGB value with HSV functions. This is not the case on HTML5. Could be tweaked sometime..?
documentation clearly explains the make_color_hsv 0-255 parameter range, have left as is for compatibility reasons also. Updated the sample to pass hsv values scaled to expected range, resulting colour is as expected.
Updated the paramaters to retain the fractional component, re comment by YellowAfterlife
ColorTest (1).yyz (38,467 bytes)