If I remove the alphachannel/mask, then it uses all colors of the palette.
I think this is a bug or if I haven't figured out the reason, please let me know. Or if there's any simple workaround... tested on MorphOS.
Code: Select all
@PALETTE 1, {Type = #PALETTE_GRAY4}
SetFillStyle(#FILLCOLOR)
; Palette based brush as the destination
CreateBrush(1, 400, 300, {Palette=1})
pal = GetAttribute(#BRUSH, 1, #ATTRPALETTE)
; Create an alphachannel brush to be pasted on the palette brush
CreateBrush(2, 400, 100, {AlphaChannel=True})
SelectBrush(2)
For Local i = 0 To ListItems(pal) - 1
Box(i*100, 0, 100, 100, pal[i])
Next
EndSelect()
SelectBrush(1)
; Original colors drawn directly, to be compared with other results.
For Local i = 0 To ListItems(pal) - 1
Box(i*100, 0, 100, 100, pal[i])
Next
; Let Hollywood remap the alpha channel brush. Last color is mapped wrong.
DisplayBrush(2, 0, 100)
; All colors are remapped correctly if there isn't an alpha channel.
DeleteAlphaChannel(2)
DisplayBrush(2, 0, 200)
EndSelect()
DisplayBrush(1, 0, 0)
WaitLeftMouse()