Class: ASEPalette::Color::RGB

Inherits:
ASEPalette::Color show all
Defined in:
lib/ase-palette/color.rb

Instance Attribute Summary collapse

Attributes inherited from ASEPalette::Color

#name, #type

Instance Method Summary collapse

Methods inherited from ASEPalette::Color

#model, #to_h, #to_s

Constructor Details

#initialize(name, r, g, b, type = DEFAULT_COLOR_TYPE) ⇒ RGB

Returns a new instance of RGB.



36
37
38
39
40
41
42
# File 'lib/ase-palette/color.rb', line 36

def initialize(name, r, g, b, type = DEFAULT_COLOR_TYPE)
  @name = name
  @r = r
  @g = g
  @b = b
  @type = type
end

Instance Attribute Details

#bObject

Returns the value of attribute b.



35
36
37
# File 'lib/ase-palette/color.rb', line 35

def b
  @b
end

#gObject

Returns the value of attribute g.



35
36
37
# File 'lib/ase-palette/color.rb', line 35

def g
  @g
end

#rObject

Returns the value of attribute r.



35
36
37
# File 'lib/ase-palette/color.rb', line 35

def r
  @r
end

Instance Method Details

#dataObject



43
44
45
# File 'lib/ase-palette/color.rb', line 43

def data
  { r: @r, g: @g, b: @b }
end