RGB decodieren

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    int r, g, b;
    TColor Clr = ColorBox1->Selected;

    r = Clr & 0xFF;
    g = (Clr & 0xFF00) / 0x100;
    b = (Clr & 0xFF0000) / 0x10000;
}

Schreibe einen Kommentar