Hex constant method starts from ".a": 0xCCCCCC.argb
Виталий Фадеев
vital.fadeev at gmail.com
Tue Dec 15 05:16:24 UTC 2020
On Tuesday, 15 December 2020 at 05:10:27 UTC, Виталий Фадеев
wrote:
> On Tuesday, 15 December 2020 at 05:04:46 UTC, Виталий Фадеев
> wrote:
>> On Monday, 14 December 2020 at 16:19:18 UTC, Adam D. Ruppe
>> wrote:
>>> On Monday, 14 December 2020 at 16:11:16 UTC, Jacob Carlborg
>>> wrote:
>>>> Or you can call it `rgba`. It seems to be what Wikipedia
>>>> prefers [1].
>>>
>>> The ordering here tends to reflect the bytes. So argb puts
>>> the alpha byte first in the array whereas rgba puts red first.
>>>
>>> But there's other ways here including just saying argb(...)
>>> or foo.as!"argb" or whatever well.
>>
>> I think about .rgba.
>>
>> Yes. The ordering! The logic.
>>
>> ARGB = .argb
>>
>> Thanks!
>
> 0x00AABBCC.argb
>
> 0x00AABBCC - is ARGB value
> .argb - is unit
>
> ...in my logic.
>
> 120.px
> 120 - is Pixel value
> .px - is unit
>
> ...in my logic.
>
> 100.percent
> 100 - is Percent value
> .percent - is unit
>
> ...in my logic.
> )
>
> Thanks!
This concept:
class X
{
this()
{
props.fontFace = "Ubuntu Mono";
props.fontSize = 24.px;
props.lineHeight = 15.px;
props.color = 0xFFFFFF;
props.backColor = 0x222222;
// or
props.color = 0xFFFFFF.rgb;
props.backColor = 0x222222.rgb;
// or
props.color = 0x88FFFFFF.argb;
props.backColor = 0x88222222.argb;
}
}
Thanks!
)
More information about the Digitalmars-d-learn
mailing list