Class: Discordrb::ColourRGB

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data.rb

Overview

A colour (red, green and blue values). Used for role colours

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#blueObject (readonly)

Returns the value of attribute blue.



644
645
646
# File 'lib/discordrb/data.rb', line 644

def blue
  @blue
end

#combinedObject (readonly)

Returns the value of attribute combined.



644
645
646
# File 'lib/discordrb/data.rb', line 644

def combined
  @combined
end

#greenObject (readonly)

Returns the value of attribute green.



644
645
646
# File 'lib/discordrb/data.rb', line 644

def green
  @green
end

#redObject (readonly)

Returns the value of attribute red.



644
645
646
# File 'lib/discordrb/data.rb', line 644

def red
  @red
end