Hi !
RESUME: Color int returned by reaper.GetMediaTrackInfo_Value(track, "I_CUSTOMCOLOR") is wrong on mac. Only tested in Lua.
We experienced a strange bug with Heda, when passing a GFX script that use track color (int to rgb) as gfx.color variable
I tested a simple script that return different color int value, on windows and on mac.
The script:
Code:
item = reaper.GetMediaItem(0, 0)
take = reaper.GetActiveTake(item, 0)
track = reaper.GetTrack (0, 0)
item_color_int = reaper.GetMediaItemInfo_Value(item, "I_CUSTOMCOLOR")
take_color_int = reaper.GetMediaItemTakeInfo_Value(take, "I_CUSTOMCOLOR")
track_color_int = reaper.GetMediaTrackInfo_Value(track, "I_CUSTOMCOLOR")
take_color_int_displayed = reaper.GetDisplayedMediaItemColor2(item, take)
function Msg(value)
reaper.ShowConsoleMsg(tostring(value).."\n")
end
Msg("Item INT color: "..item_color_int)
Msg("Take INT color: "..take_color_int)
Msg("Track INT color: "..track_color_int)
Msg("Take INT displayed color: "..take_color_int_displayed)
On windows, it displayed:
Item INT color: 16777429.0
Take INT color: 16777429.0
Track INT color: 30784000.0
Take INT displayed color: 16777429
On mac (same project):
Item INT color: 16777429.0
Take INT color: 16777429.0
Track INT color: 16825045.0
Take INT displayed color: 16777429
As you can see, track Int color is different.
Deeper test reveals that this is an inversion of R and B channel.
Windows:
Quote:
track_color_r = 213
track_color_v = 186
track_color_b = 0
|
Mac:
To reproduce:
- create a project
- insert one track, color it
- insert one midi item, color it
- run the script
- compare results.
You can also use this test project and report your console messages:
https://www.dropbox.com/s/0i3f4weckm...itled.RPP?dl=0
I didn't test it with other int color than these one. I only tested with Lua.
I wonder if it could also explained why my color palette are shifted when I used them on mac.
As this involves having a mac AND a pc, I don't know if there would be a lot of tester. But the bug is there, without any doubt.
Discussion: Track Color Int on Mac is wrong