//
// cocos2d::extension::CCControlUtils::RGBfromHSV from 0x5a4f20 to 0x5a500c (236 bytes)
//
// 9 xrefs:
// > GameToolbox::transformColor @ 0x2ec952
// > ColorSelectLiveOverlay::sliderChanged @ 0x4ce49a
// > ColorSelectLiveOverlay::sliderChanged @ 0x4ce50c
// > ColorSelectLiveOverlay::sliderChanged @ 0x4ce578
// > ColorSelectLiveOverlay::selectColor @ 0x4ce760
// > ColorSelectLiveOverlay::selectColor @ 0x4ce7cc
// > cocos2d::extension::CCControlColourPicker::colourSliderValueChanged @ 0x5a24e8
// > cocos2d::extension::CCControlColourPicker::hueSliderValueChanged @ 0x5a26cc
// > cocos2d::extension::CCControlSaturationBrightnessPicker::updateWithHSV @ 0x5a314a
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
double *__fastcall cocos2d::extension::CCControlUtils::RGBfromHSV(double *result, double a2, double a3, double a4)
{
double v5; // d7
double v6; // d7
int v7; // r3
double v8; // d7
double v9; // d4
double v10; // d3
double v11; // d5
v5 = a2;
result[3] = 1.0;
if ( a3 > 0.0 )
{
if ( a2 >= 360.0 )
v5 = 0.0;
v6 = v5 * 0.0166666675;
v7 = (int)v6;
v8 = v6 - (double)(int)v6;
v9 = a4 * (1.0 - a3);
v10 = a4 * (1.0 - a3 * v8);
v11 = a4 * (1.0 - a3 * (1.0 - v8));
switch ( v7 )
{
case 0:
*result = a4;
result[1] = v11;
goto LABEL_7;
case 1:
*result = v10;
result[1] = a4;
LABEL_7:
result[2] = v9;
break;
case 2:
*result = v9;
result[1] = a4;
result[2] = v11;
break;
case 3:
*result = v9;
result[1] = v10;
goto LABEL_12;
case 4:
*result = v11;
result[1] = v9;
goto LABEL_12;
default:
*result = a4;
result[1] = v9;
result[2] = v10;
break;
}
}
else
{
*result = a4;
result[1] = a4;
LABEL_12:
result[2] = a4;
}
return result;
}