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

It's parsing the `.a` in `.argb` as part of the number:

auto color = 0x00AABBCC.a rgb; // what the compiler sees

You can fix it with parentheses:

auto color = (0x00AABBCC).argb;

Thanks!

It is not perfect, but also beauty!

Or you can call it `rgba`. It seems to be what Wikipedia prefers [1].

[1] https://en.wikipedia.org/wiki/RGBA_color_model

--
/Jacob Carlborg
  • 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