//
// cocos2d::extension::CCControlUtils::RGBfromHSV from 0xaa0430 to 0xaa0590 (352 bytes)
//
// 10 xrefs:
// > GameToolbox::transformColor @ 0x580f3c
// > ColorSelectLiveOverlay::sliderChanged @ 0x90ac2c
// > ColorSelectLiveOverlay::sliderChanged @ 0x90aca0
// > ColorSelectLiveOverlay::sliderChanged @ 0x90ad0c
// > ColorSelectLiveOverlay::selectColor @ 0x90af20
// > ColorSelectLiveOverlay::selectColor @ 0x90af90
// > cocos2d::extension::CCControlColourPicker::colourSliderValueChanged @ 0xa9c7cc
// > cocos2d::extension::CCControlColourPicker::hueSliderValueChanged @ 0xa9c998
// > cocos2d::extension::CCControlSaturationBrightnessPicker::updateWithHSV @ 0xa9d864
// > ??> @ 0xb79f0
//
// 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 a1, double a2, double a3)
{
double v3; // d3
double v5; // d0
__int64 v6; // x0
double v7; // d2
bool v8; // cc
double v9; // d0
double v10; // d4
double v11; // d0
double v12; // d1
v3 = a3;
if ( a2 <= 0.0 )
return a3;
if ( a1 < 360.0 )
{
v5 = a1 * 0.0166666675;
v6 = (__int64)v5;
v7 = (1.0 - a2) * a3;
v8 = (unsigned __int64)(__int64)v5 > 4;
v9 = v5 - (double)(__int64)v5;
v10 = 1.0 - v9;
v11 = (1.0 - v9 * a2) * v3;
v12 = (1.0 - v10 * a2) * v3;
if ( !v8 )
{
switch ( (int)v6 )
{
case 1:
v3 = v11;
break;
case 2:
v3 = v7;
break;
case 3:
v3 = v7;
break;
case 4:
v3 = v12;
break;
default:
return v3;
}
}
}
return v3;
}