Class: MG::Color

Inherits:
Object
  • Object
show all
Defined in:
doc/API_reference.rb

Overview

The MG::Color.new constructor will return the black color.

Instance Attribute Summary collapse

Constructors collapse

Constructor Details

#initializeColor #initialize(ary) ⇒ Color #initialize(red, green, blue, alpha = 1.0) ⇒ Color

Returns a new instance of Color.

Overloads:

  • #initializeColor

    Creates a new object with default color set.

  • #initialize(ary) ⇒ Color

    Creates a new object with 3-element or 4-element Array.

    Parameters:

    • ary (Array)

      3-element or 4-element Array.

  • #initialize(red, green, blue, alpha = 1.0) ⇒ Color

    Creates a new object.

    Parameters:

    • red (Float)

      the red portion of the color, from 0.0 to 1.0.

    • green (Float)

      the green portion of the color, from 0.0 to 1.0.

    • blue (Float)

      the blue portion of the color, from 0.0 to 1.0.

    • alpha (Float) (defaults to: 1.0)

      the alpha portion of the color, from 0.0 to 1.0.



1272
# File 'doc/API_reference.rb', line 1272

def initialize(*args); end

Instance Attribute Details

#alphaFloat

Returns the alpha portion of the color, from 0.0 to 1.0.

Returns:

  • (Float)

    the alpha portion of the color, from 0.0 to 1.0.



1287
1288
1289
# File 'doc/API_reference.rb', line 1287

def alpha
  @alpha
end

#blueFloat

Returns the blue portion of the color, from 0.0 to 1.0.

Returns:

  • (Float)

    the blue portion of the color, from 0.0 to 1.0.



1284
1285
1286
# File 'doc/API_reference.rb', line 1284

def blue
  @blue
end

#greenFloat

Returns the green portion of the color, from 0.0 to 1.0.

Returns:

  • (Float)

    the green portion of the color, from 0.0 to 1.0.



1281
1282
1283
# File 'doc/API_reference.rb', line 1281

def green
  @green
end

#redFloat

Returns the red portion of the color, from 0.0 to 1.0.

Returns:

  • (Float)

    the red portion of the color, from 0.0 to 1.0.



1278
1279
1280
# File 'doc/API_reference.rb', line 1278

def red
  @red
end