craftyjs.github.com

Color

Draw a solid color for the entity

Back to top

.color

Events

Change
when the color changes

public this .color(String color)

public String .color()

color
Color of the rectangle

Will create a rectangle of solid color for the entity, or return the color if no argument is given.

The argument must be a color readable depending on which browser you choose to support. IE 8 and below doesn't support the rgb() syntax.

Example

Crafty.e("2D, DOM, Color")
   .color("#969696");