//
// cocos2d::extension::CCControlUtils::RGBfromHSV from 0xd11e90 to 0xd11ff0 (352 bytes)
//
// 10 xrefs:
// > GameToolbox::transformColor @ 0x69d188
// > ColorSelectLiveOverlay::sliderChanged @ 0xa65384
// > ColorSelectLiveOverlay::sliderChanged @ 0xa653f8
// > ColorSelectLiveOverlay::sliderChanged @ 0xa65464
// > ColorSelectLiveOverlay::selectColor @ 0xa65678
// > ColorSelectLiveOverlay::selectColor @ 0xa656e8
// > cocos2d::extension::CCControlColourPicker::colourSliderValueChanged @ 0xd0e208
// > cocos2d::extension::CCControlColourPicker::hueSliderValueChanged @ 0xd0e3d4
// > cocos2d::extension::CCControlSaturationBrightnessPicker::updateWithHSV @ 0xd0f29c
// > ??> @ 0xefb60
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:07:03 +0000
//
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;
}