Class: FigmaColor
- Inherits:
-
Object
- Object
- FigmaColor
- Defined in:
- lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
Returns the value of attribute a.
-
#b ⇒ Object
Returns the value of attribute b.
-
#g ⇒ Object
Returns the value of attribute g.
-
#r ⇒ Object
Returns the value of attribute r.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(r:, g:, b:, a:) ⇒ FigmaColor
constructor
A new instance of FigmaColor.
- #to_hash ⇒ Object
Constructor Details
#initialize(r:, g:, b:, a:) ⇒ FigmaColor
Returns a new instance of FigmaColor.
6 7 8 9 10 11 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 6 def initialize(r:, g:, b:, a:) @r = r @g = g @b = b @a = a end |
Instance Attribute Details
#a ⇒ Object
Returns the value of attribute a.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 4 def a @a end |
#b ⇒ Object
Returns the value of attribute b.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 4 def b @b end |
#g ⇒ Object
Returns the value of attribute g.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 4 def g @g end |
#r ⇒ Object
Returns the value of attribute r.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 4 def r @r end |
Class Method Details
.from_hash(hash) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 13 def self.from_hash(hash) return nil if hash.nil? r = hash['r'] g = hash['g'] b = hash['b'] a = hash['a'] return FigmaColor.new(r: r, g: g, b: b, a: a) if !r.nil? && !g.nil? && !b.nil? && !a.nil? nil end |
Instance Method Details
#to_hash ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/primitives/figma_color.rb', line 26 def to_hash hash = {} hash['r'] = r hash['g'] = g hash['b'] = b hash['a'] = a hash end |