Module: Plushie::Type::Gradient
- Defined in:
- lib/plushie/type/gradient.rb
Overview
Gradient specification for widget backgrounds.
Currently supports linear gradients with angle and color stops.
Class Method Summary collapse
-
.encode(value) ⇒ Hash
Encode a gradient for the wire protocol.
-
.linear(angle, stops) ⇒ Hash
Create a linear gradient.
Class Method Details
.encode(value) ⇒ Hash
Encode a gradient for the wire protocol.
33 34 35 36 37 38 |
# File 'lib/plushie/type/gradient.rb', line 33 def encode(value) case value when Hash then value else raise ArgumentError, "invalid gradient: #{value.inspect}" end end |