Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 11-27-2021, 05:30 AM   #1
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default Linux reaper.ColorFromNative() wrong r, g, b values returned

REAPER 6.42 Linux x86-64/AMD64 64-bit

Code:
r,g,b = reaper.ColorFromNative(5432063)
reaper.ShowConsoleMsg("\n")
reaper.ShowConsoleMsg(r)
reaper.ShowConsoleMsg("\n")
reaper.ShowConsoleMsg(g)
reaper.ShowConsoleMsg("\n")
reaper.ShowConsoleMsg(b)
If Windows returns: r g b
255
226
82

On Linux I get: b g r
82
226
255
heda is offline   Reply With Quote
Old 11-27-2021, 06:56 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,746
Default

Sadly the byte-ordering of RGB vs BGR is backwards on REAPER/macOS and REAPER/Linux... :/ If you know the byte order, you should decompose the bytes yourself
Justin is online now   Reply With Quote
Old 11-29-2021, 11:26 AM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

ah ... ok thanks
I thought ColorFromNative was introduced exactly to address this issue between Mac and Windows and maybe Linux was not working the same. I have not received any issue from Mac users and I was not aware. I'm more confused now and I cannot test on Mac.
I think I'll just store colors as separated r g b values instead of one integer.
heda is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.