Class: Rainbow::Opacity

Inherits:
Object
  • Object
show all
Defined in:
lib/rainbow/opacity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, location) ⇒ Opacity

value - Fixnum (0-100) location - Fixnum (0-100)



8
9
10
11
12
13
14
# File 'lib/rainbow/opacity.rb', line 8

def initialize(value, location)
  @value_percentage = value
  @value            = (255.0 * value / 100).round
  @location         = location

  assert_arguments!
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



4
5
6
# File 'lib/rainbow/opacity.rb', line 4

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/rainbow/opacity.rb', line 4

def value
  @value
end