Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PALETTE: why does it take "BGR" colour instead of "RGB"?
#7
(01-17-2023, 08:39 AM)SMcNeill Wrote:
(01-17-2023, 03:59 AM)CharlieJV Wrote: It just seems a little odd that you can't apply colours that you would get via _RGB32() in the PALETTE statement.

Is there some history to explain the second parameter for colour?

Use the https://qb64phoenix.com/qb64wiki/index.php/PALETTECOLOR statement, rather than the old QB45 PALETTE command.  Smile


As for the major difference in the commands, the biggest change is https://en.wikipedia.org/wiki/Endianness.   QB45 stored the values as BGR, while QB64 stores them as ARGB values.  In QB45, they followed the https://qb64phoenix.com/qb64wiki/index.php/DAC format, rather than our modern ARGB format.  

You need to be aware of which command, and which format style you're making use of, so that you can format your colors properly with the two commands.  Smile

Now what I've seen in wwwBASIC makes sense.  The contributors to that project seemingly had QB45 (and/or earlier) compatibility-ish in mind.  (colours stored as BGR values for screen modes with defined colour maps.

Thanks for the info !
Reply


Messages In This Thread
RE: PALETTE: why does it take "BGR" colour instead of "RGB"? - by CharlieJV - 01-17-2023, 01:25 PM



Users browsing this thread: 2 Guest(s)