Class: DYI::Drawing::ColorEffect::GradientStop

Inherits:
Object
  • Object
show all
Defined in:
lib/dyi/drawing/color_effect.rb

Overview

Since:

  • 0.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(offset, options = {}) ⇒ GradientStop

Returns a new instance of GradientStop.

Since:

  • 0.0.0



216
217
218
219
220
# File 'lib/dyi/drawing/color_effect.rb', line 216

def initialize(offset, options={})
  @offset = offset.to_f
  self.color = options[:color]
  self.opacity = options[:opacity]
end

Instance Attribute Details

#colorObject

Since:

  • 0.0.0



214
215
216
# File 'lib/dyi/drawing/color_effect.rb', line 214

def color
  @color
end

#offsetObject (readonly)

Since:

  • 0.0.0



214
215
216
# File 'lib/dyi/drawing/color_effect.rb', line 214

def offset
  @offset
end

#opacityObject

Since:

  • 0.0.0



214
215
216
# File 'lib/dyi/drawing/color_effect.rb', line 214

def opacity
  @opacity
end

Instance Method Details

#write_as(formatter, io = $>) ⇒ Object

Since:

  • 0.0.0



232
233
234
# File 'lib/dyi/drawing/color_effect.rb', line 232

def write_as(formatter, io=$>)
  formatter.write_gradient_stop(self, io)
end