This works for both Win and Mac using RGB rather than color int.
Code:
reaper.Main_OnCommand(40630,0) -- Go to start of time selection 40630
reaper.Main_OnCommand(40718,0) -- Item: Select all items on selected tracks in current time selection 40718
track = reaper.GetSelectedTrack(0,0)
item_count = reaper.CountSelectedMediaItems(0)
for i = 0, item_count -1 do
isdel = reaper.GetSelectedMediaItem( 0, i )
if isdel then
color = reaper.GetMediaItemInfo_Value(isdel, ("I_CUSTOMCOLOR"))
rOut, gOut, bOut = reaper.ColorFromNative(color)
if (rOut ~= 115) and (gOut ~= 23) and (bOut ~= 17) then reaper.DeleteTrackMediaItem( track, isdel )
end
end
end