Class: Discordrb::ColorRGB
- Inherits:
-
Object
- Object
- Discordrb::ColorRGB
- Defined in:
- lib/discordrb/data.rb
Overview
A colour (red, green and blue values). Used for role colours
Instance Attribute Summary collapse
-
#blue ⇒ Object
readonly
Returns the value of attribute blue.
-
#green ⇒ Object
readonly
Returns the value of attribute green.
-
#red ⇒ Object
readonly
Returns the value of attribute red.
Instance Method Summary collapse
-
#initialize(combined) ⇒ ColorRGB
constructor
A new instance of ColorRGB.
Constructor Details
#initialize(combined) ⇒ ColorRGB
Returns a new instance of ColorRGB.
383 384 385 386 387 |
# File 'lib/discordrb/data.rb', line 383 def initialize(combined) @red = (combined >> 16) & 0xFF @green = (combined >> 8) & 0xFF @blue = combined & 0xFF end |
Instance Attribute Details
#blue ⇒ Object (readonly)
Returns the value of attribute blue.
381 382 383 |
# File 'lib/discordrb/data.rb', line 381 def blue @blue end |
#green ⇒ Object (readonly)
Returns the value of attribute green.
381 382 383 |
# File 'lib/discordrb/data.rb', line 381 def green @green end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
381 382 383 |
# File 'lib/discordrb/data.rb', line 381 def red @red end |