On Monday, 14 December 2020 at 05:24:39 UTC, Виталий Фадеев wrote:

... msg ...


But...:
    Color rgb( uint color )
    {
        return
            Color( cast( uint ) (
                ( ( color & 0x000000FF ) << 16 )  |
                ( ( color & 0x0000FF00 ) )  |
                ( ( color & 0x00FF0000 ) >> 16 )
            ) );
    }

unittest
{
    auto color2 = 0x00AABBCC.rgb;
}

".rgb"  Compiled fine.
".argb" Compilation error.


Source:
    https://run.dlang.io/is/ULQ4kh


  • Hex constant method st... Виталий Фадеев via Digitalmars-d-learn
    • Re: Hex constant ... Виталий Фадеев via Digitalmars-d-learn
      • Re: Hex const... Paul Backus via Digitalmars-d-learn
        • Re: Hex c... Виталий Фадеев via Digitalmars-d-learn
          • Re: H... Jacob Carlborg via Digitalmars-d-learn
            • ... Adam D. Ruppe via Digitalmars-d-learn
              • ... Виталий Фадеев via Digitalmars-d-learn
                • ... Виталий Фадеев via Digitalmars-d-learn
                • ... Виталий Фадеев via Digitalmars-d-learn

Reply via email to