Beispiel #1
0
RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a)
{
    return colorFloatToRGBAByte(a) << 24 | colorFloatToRGBAByte(r) << 16 | colorFloatToRGBAByte(g) << 8 | colorFloatToRGBAByte(b);
}
Beispiel #2
0
RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha)
{
    RGBA32 rgbOnly = color & 0x00FFFFFF;
    RGBA32 rgba = rgbOnly | colorFloatToRGBAByte(overrideAlpha) << 24;
    return rgba;
}
Color Color::combineWithAlpha(float otherAlpha) const
{
    RGBA32 rgbOnly = rgb() & 0x00FFFFFF;
    float overrideAlpha = (alpha() / 255.f) * otherAlpha;
    return rgbOnly | colorFloatToRGBAByte(overrideAlpha) << 24;
}