Class: Discordrb::ColorRGB

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) ⇒ 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

#blueObject (readonly)

Returns the value of attribute blue.



381
382
383
# File 'lib/discordrb/data.rb', line 381

def blue
  @blue
end

#greenObject (readonly)

Returns the value of attribute green.



381
382
383
# File 'lib/discordrb/data.rb', line 381

def green
  @green
end

#redObject (readonly)

Returns the value of attribute red.



381
382
383
# File 'lib/discordrb/data.rb', line 381

def red
  @red
end