Author Topic: The number _RGB32()  (Read 2459 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
The number _RGB32()
« on: September 01, 2018, 06:31:39 am »
The color parameter _RGB32() is an Unsigned Long variable type (~&).  I recently had to look at the actual value of this number for Red/Green/Blue values 0-255, and I was expecting that _RGB32() would lie in the range 0 - 16777215 (256^3), and was surprised to find that it lies in the range 4278190079 - 4294967295 (4294967296 is 256^4 or 2^32).  The remaining numbers are doubtless taken up with the additional 255/256ths when dealing with alpha.

I was just curious as to why someone started at the top number and worked his/her way down.  The 'natural' approach (?) would be to work up from zero.

Richard

FellippeHeitor

  • Guest
Re: The number _RGB32()
« Reply #1 on: September 01, 2018, 07:16:54 am »
It's not RGBA internally, it's ARGB, which is why all values with full alpha are that high.