Common Graphics Support for Alpha Blending on Windows

When displaying colors in graphics, the foreground color, which is what is being drawn, can either be opaque or translucent. When it is translucent, the background color will show through. In Common Graphics, colors are created with the function make-rgb. This function has an alpha keyword argument. The alpha value can be any integer from 0 to 255, with 0 meaning the foreground color is clear so the background color simply shows through while 255 means the color is opaque so background color does not show through at all.

Alpha blending is controlled by the variable cg:*alpha-blending*. This variable is a boolean. When true, the alpha value of a color is used when the color is the foreground color. When the variable is false, all colors drawn are opaque.

Alpha blending is only supported on Windows. See cg:*alpha-blending* for full details. An eaxmple on that page produced the following pictures (which we include here because they look very cool):

Copyright © 2021 Franz Inc., All Rights Reserved | Privacy Statement Twitter