//
// LevelSelectLayer::getColorValue from 0x511994 to 0x511ac4 (304 bytes)
//
// 1 xrefs:
// > LevelSelectLayer::scrollLayerMoved @ 0x511bd0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:51:32 +0000
//
int __fastcall LevelSelectLayer::getColorValue(LevelSelectLayer *this, int a2, int a3, float a4)
{
float v6; // s16
int v7; // r0
int v8; // r0
float v9; // s11
__int16 v11; // [sp+1Ch] [bp-10h]
unsigned __int8 v12; // [sp+1Eh] [bp-Eh]
__int16 v13; // [sp+20h] [bp-Ch]
unsigned __int8 v14; // [sp+22h] [bp-Ah]
v6 = (float)(a4 / 0.66667) - 0.2;
if ( v6 >= 1.0 )
{
v6 = 1.0;
}
else if ( v6 <= 0.0 )
{
v6 = 0.0;
}
v7 = LevelSelectLayer::colorForPage(this, a2);
v11 = v7;
v12 = BYTE2(v7);
v8 = LevelSelectLayer::colorForPage(this, a3);
v13 = v8;
v14 = BYTE2(v8);
v9 = COERCE_DOUBLE(modifyValue(v6));
return (unsigned __int8)(unsigned int)(float)((float)((float)(unsigned __int8)v13 * v9)
+ (float)((float)(unsigned __int8)v11 * (float)(1.0 - v9)))
| (unsigned __int16)((unsigned __int8)(unsigned int)(float)((float)((float)HIBYTE(v13) * v9)
+ (float)((float)HIBYTE(v11) * (float)(1.0 - v9))) << 8)
| ((unsigned __int8)(unsigned int)(float)((float)((float)v14 * v9) + (float)((float)v12 * (float)(1.0 - v9))) << 16);
}