Class: SDC::Color

Inherits:
Object
  • Object
show all
Defined in:
engine_docs/automatic_doc_Color.rb,
engine_docs/automatic_doc_Color.rb

Overview

RGBA color class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(r = 0, g = 0, b = 0, a = 255) ⇒ Color

Creates a color with RGBA values ranging from 0 to 255

Parameters:

  • r (Integer) (defaults to: 0)
  • g (Integer) (defaults to: 0)
  • b (Integer) (defaults to: 0)
  • a (Integer) (defaults to: 255)


# File 'engine_docs/automatic_doc_Color.rb', line 9

Instance Attribute Details

#aInteger

The alpha value of the color, ranging from 0 to 255

Returns:

  • (Integer)


# File 'engine_docs/automatic_doc_Color.rb', line 35

#bInteger

The blue value of the color, ranging from 0 to 255

Returns:

  • (Integer)


# File 'engine_docs/automatic_doc_Color.rb', line 31

#gInteger

The green value of the color, ranging from 0 to 255

Returns:

  • (Integer)


# File 'engine_docs/automatic_doc_Color.rb', line 27

#rInteger

The red value of the color, ranging from 0 to 255

Returns:

  • (Integer)


# File 'engine_docs/automatic_doc_Color.rb', line 23

Instance Method Details

#*(other) ⇒ Color

Multiplies the two color values by components to a new value

Parameters:

Returns:



# File 'engine_docs/automatic_doc_Color.rb', line 51

#+(other) ⇒ Color

Adds the two color values by components to a new value

Parameters:

Returns:



# File 'engine_docs/automatic_doc_Color.rb', line 39

#-(other) ⇒ Color

Subtracts the two color values by components to a new value

Parameters:

Returns:



# File 'engine_docs/automatic_doc_Color.rb', line 45

#inspectString

Creates a string with verbose RGBA information

Returns:

  • (String)


# File 'engine_docs/automatic_doc_Color.rb', line 62

#to_iInteger

Converts the color RGBA value to a 32 bit integer value

Returns:

  • (Integer)


# File 'engine_docs/automatic_doc_Color.rb', line 18

#to_sString

Converts the color RGBA value to a space-separated string

Returns:

  • (String)


# File 'engine_docs/automatic_doc_Color.rb', line 57