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
705 706 707 708 709 710 |
# File 'lib/discordrb/data.rb', line 705 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.
703 704 705 |
# File 'lib/discordrb/data.rb', line 703 def blue @blue end |
#combined ⇒ Object (readonly)
Returns the value of attribute combined.
703 704 705 |
# File 'lib/discordrb/data.rb', line 703 def combined @combined end |
#green ⇒ Object (readonly)
Returns the value of attribute green.
703 704 705 |
# File 'lib/discordrb/data.rb', line 703 def green @green end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
703 704 705 |
# File 'lib/discordrb/data.rb', line 703 def red @red end |