colors module

colors module provides color-related functions.

getColor ( String name ) or
( int rgb ) or
(int red, int green, int blue {, int alpha })

getColor() returns a java.awt.Color object.

If name is specified, it should be a keyword of this name-RGB mapping.

e.g.
getColor(0xffffff)
   ==> java.awt.Color[r=255,g=255,b=255]
getColor("blue")
   ==> java.awt.Color[r=0,g=0,b=255]
getColorModel ( Image image )

getColorModel() returns a java.awt.image.ColorModel object.

e.g.
image = makeImage(10, 10, function (g) null)
getColorModel(image)
    ==> DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0
hasAlpha ( Image image )

hasAlpha() checks if the specified image has alpha channel.

e.g.
image = makeImage(10, 10, function (g) null, TYPE_INT_ARGB)
hasAlpha(image)
      ==> true