











2






color integer (like default 65408 value) in TW? and how to convert ColorRGBA to it?



connect ip:port



color integer (like default 65408 value) in TW? and how to convert ColorRGBA to it? 




ColorRGBA, or ColorHSLA to this magic intint ColorBody = ColorHSLA(m_ColorBody).UnclampLighting().Pack(ms_DarkestLGT7);
player_color_body, when you print it, you get color in all representation, look how he translates it one to another



player_color_body, when you print it, you get color in all representation, look how he translates it one to another 


unsigned Pack(bool Alpha = true)
{
return (Alpha ? ((unsigned)(a * 255.0f) << 24) : 0) + ((unsigned)(x * 255.0f) << 16) + ((unsigned)(y * 255.0f) << 8) + (unsigned)(z * 255.0f);
}







color4_base(unsigned col, bool alpha = false)
{
a = alpha ? ((col >> 24) & 0xFF) / 255.0f : 1.0f;
x = ((col >> 16) & 0xFF) / 255.0f;
y = ((col >> 8) & 0xFF) / 255.0f;
z = ((col >> 0) & 0xFF) / 255.0f;
}
and indeed pack transforms from HSLA into "magic number, H=x, S=y, L=z
unsigned Pack(bool Alpha = true)
{
return (Alpha ? ((unsigned)(a * 255.0f) << 24) : 0) + ((unsigned)(x * 255.0f) << 16) + ((unsigned)(y * 255.0f) << 8) + (unsigned)(z * 255.0f);
}
ColorRGBA test{1.0f, 0.0f, 1.0f};
dbg_msg("TESTING", "Color converted: %u", test.Pack()); (edited)console: Value: 16711935
console: H: 360°, S: 0%, L: 100%
console: R: 255, G: 255, B: 255, #FFFFFF (edited)
RGBA to magic int?ColorRGBA class is only for storing RGBA values to be converted to HSL?
ColorRGBA to "magic" teeworlds colors you do color_cast<ColorHSLA>(ColorRGBA(1.0f, 0.0f, 1.0f))
ColorRGBA::Pack() ?
ColorRGBA::Pack it will give you a packed rgba color instead of hsla though
class ColorRGBA : public color4_base<ColorRGBA>
{
public:
using color4_base::color4_base;
ColorRGBA(){};
};

console: Value: 16711935
console: H: 360°, S: 0%, L: 100%
console: R: 255, G: 255, B: 255, #FFFFFF (edited)1.0f which had to mean R(255), but it actually means H(360) (edited)
ColorHSLA::Pack is also the PackIntoTwColor










