View Issue Details

IDProjectCategoryView StatusLast Update
0029758RunnerFunctionsPublic2018-08-13 13:59
ReporterStewart BishopAssigned ToAlan Savage 
PriorityLowSeverityC - GeneralReproducibility100%
Status ResolvedResolutionFixed 
Product Version2.1.4 
Target Version2.2.1Fixed in Version2.2.1 
Summary0029758: Functions: make_color_hsv) is not producing the same colours as its RGB counter part using the same colour values
DescriptionIf 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 Reproduce1) Run the sample
2) See the differences
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In2.1.5.237
2.x Runtime Verified In

Activities

Stewart Bishop

2018-07-05 13:45

Adminstrator  

ColorTest.yyz (19,862 bytes)

YellowAfterlife

2018-07-14 22:01

Developer   ~0060860

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..?

Alan Savage

2018-08-08 15:27

Developer   ~0061110

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

Alan Savage

2018-08-08 15:27

Developer  

ColorTest (1).yyz (38,467 bytes)