Class: Discordrb::ColourRGB
- Inherits:
-
Object
- Object
- Discordrb::ColourRGB
- 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.
-
#combined ⇒ Object
readonly
Returns the value of attribute combined.
-
#green ⇒ Object
readonly
Returns the value of attribute green.
-
#red ⇒ Object
readonly
Returns the value of attribute red.
Instance Method Summary collapse
-
#initialize(combined) ⇒ ColourRGB
constructor
A new instance of ColourRGB.
Constructor Details
#initialize(combined) ⇒ ColourRGB
Returns a new instance of ColourRGB.
646 647 648 649 650 651 |
# File 'lib/discordrb/data.rb', line 646 def initialize(combined) @combined = 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.
644 645 646 |
# File 'lib/discordrb/data.rb', line 644 def blue @blue end |
#combined ⇒ Object (readonly)
Returns the value of attribute combined.
644 645 646 |
# File 'lib/discordrb/data.rb', line 644 def combined @combined end |
#green ⇒ Object (readonly)
Returns the value of attribute green.
644 645 646 |
# File 'lib/discordrb/data.rb', line 644 def green @green end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
644 645 646 |
# File 'lib/discordrb/data.rb', line 644 def red @red end |