Star Ruby Ruby extension library for creating 2D games

StarRuby::Color

Class represents color

Since this class is immutable, you can use it as if it is a value.

eql? method and hash method were redeclared so that instances of Color class can be used as keys of Hash.

Class mothod

Color.new(red, green, blue, alpha = 255)

Generate new Color object.

Each color factor must be set between 0 and 255.

Instance methods

self == other

Compares whether the color is the same value or not.

red
green
blue
alpha

Get values of each components(red, green blue, alpha) as integer (0 〜 255) .

© Copyright 2012 Hajime Hoshi