Class: Compass::Magick::Types::Gradients::ColorStop
- Inherits:
-
Compass::Magick::Type
- Object
- Compass::Magick::Type
- Compass::Magick::Types::Gradients::ColorStop
- Includes:
- Utils
- Defined in:
- lib/magick/types/gradients.rb
Overview
A type that is used when constructing gradients to have precise control over color stops.
Instance Attribute Summary collapse
-
#color ⇒ Sass::Script::Color
readonly
The color at the offset.
-
#offset ⇒ Sass::Script::Number
readonly
The color stop offset, 0-100.
Attributes included from Scriptable
Instance Method Summary collapse
-
#initialize(offset, color) ⇒ ColorStop
constructor
Initializes a new ColorStop instance.
Methods included from Utils
#assert_one_of, #assert_type, #to_canvas, #to_chunky_color, #value_of
Methods inherited from Compass::Magick::Type
Constructor Details
#initialize(offset, color) ⇒ ColorStop
Initializes a new ColorStop instance.
19 20 21 22 23 24 |
# File 'lib/magick/types/gradients.rb', line 19 def initialize(offset, color) assert_type 'offset', offset, Sass::Script::Number assert_type 'color', color, Sass::Script::Color @offset = offset @color = color end |
Instance Attribute Details
#color ⇒ Sass::Script::Color (readonly)
Returns The color at the offset.
30 31 32 |
# File 'lib/magick/types/gradients.rb', line 30 def color @color end |
#offset ⇒ Sass::Script::Number (readonly)
Returns The color stop offset, 0-100.
27 28 29 |
# File 'lib/magick/types/gradients.rb', line 27 def offset @offset end |