So, I was detecting brushes as palette brushes if their depth was less than 9, but got issues because some RGB brushes reported their depth as 0.
Here are couple examples where I noticed it. Tested on MorphOS.
Code: Select all
CreateGradientBrush(1, 640, 480, #LINEAR, #WHITE, #BLUE)
DisplayBrush(1, 0, 0)
DebugPrint("CreateGradientBrush depth:", GetAttribute(#BRUSH, 1, #ATTRDEPTH)) ; Why this tells the depth is 0? It's less than 8, but still an RGB brush?
CreateBrush(2, 200, 100, #RED)
DebugPrint("CreateBrush depth:", GetAttribute(#BRUSH, 2, #ATTRDEPTH)) ; Tells it's 24bit.
DisplayBrush(2, 0, 0)
SetClipboard(#CLIPBOARD_IMAGE, 2)
type, id = GetClipboard()
DebugPrint("GetClipboard depth:", GetAttribute(#BRUSH, id, #ATTRDEPTH)) ; Tells it's 0bit.
DisplayBrush(id, 200, 200)
WaitLeftMouse()