Class: LiteRGSS::Color

Inherits:
Object show all
Defined in:
LiteRGSS.rb.yard.rb

Overview

Class that describes RGBA colors in integer scale (0~255)

Direct Known Subclasses

Color, Viewport::WithToneAndColors::Color

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Create a new color

Parameters:

  • red (Integer, nil) —

    between 0 and 255

  • green (Integer, nil) —

    between 0 and 255

  • blue (Integer, nil) —

    between 0 and 255

  • alpha (Integer, nil) (defaults to: 255) —

    between 0 and 255 (default : 255)



65
66
67
# File 'LiteRGSS.rb.yard.rb', line 65

def initialize(red, green, blue, alpha = 255)

end

Instance Attribute Details

#alpha ⇒ Integer

Returns The alpha opacity of the color.

Returns:

  • (Integer) —

    The alpha opacity of the color



59
60
61
# File 'LiteRGSS.rb.yard.rb', line 59

def alpha
  @alpha
end

#blue ⇒ Integer

Returns The blue component of the color.

Returns:

  • (Integer) —

    The blue component of the color



57
58
59
# File 'LiteRGSS.rb.yard.rb', line 57

def blue
  @blue
end

#green ⇒ Integer

Returns The green component of the color.

Returns:

  • (Integer) —

    The green component of the color



55
56
57
# File 'LiteRGSS.rb.yard.rb', line 55

def green
  @green
end

#red ⇒ Integer

Returns The red component of the color.

Returns:

  • (Integer) —

    The red component of the color



53
54
55
# File 'LiteRGSS.rb.yard.rb', line 53

def red
  @red
end

Instance Method Details

#inspect ⇒ String

Convert the color to a string that can be shown to the user

Returns:



84
85
86
# File 'LiteRGSS.rb.yard.rb', line 84

def inspect

end

#set(red, green = nil, blue = nil, alpha = nil) ⇒ self

Set the color parameters

Parameters:

  • red (Integer, nil) —

    between 0 and 255

  • green (Integer, nil) (defaults to: nil) —

    between 0 and 255

  • blue (Integer, nil) (defaults to: nil) —

    between 0 and 255

  • alpha (Integer, nil) (defaults to: nil) —

    between 0 and 255

Returns:

  • (self)


74
75
76
# File 'LiteRGSS.rb.yard.rb', line 74

def set(red, green = nil, blue = nil, alpha = nil)

end

#to_s ⇒ String

Convert the color to a string that can be shown to the user

Returns:



79
80
81
# File 'LiteRGSS.rb.yard.rb', line 79

def to_s

end