Make Piececolor options work on png pieces
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 6 Oct 2012 17:54:50 +0000 (19:54 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 21 Oct 2012 09:28:17 +0000 (11:28 +0200)
commit8c8feabe34a974805b243ca3c9268e3ec296d6cb
tree544207c593c7dc94505713bb4b394cc34de37ea4
parent1d141d619141de1c5ceb976683cf856eb58bba75
Make Piececolor options work on png pieces

The scaled, antialiased bitmaps are now colored according to the option
settings. This is done by decomposing every pixel in a white, black and
transparency component, which is possible because the opacity is
directly give in the alpha channel, and black originally was a hard zero.
So what you se in the red channel must be white (as the original white
was #FFFFCC), and the rest of the opacity must be due to black.
  The color to be replaced (white for the white pieces, black for the black
pieces) is then replaced by the original weight of this color times the
color from the option.
draw.c