Class: Ra::Pattern::Gradient

Inherits:
Base
  • Object
show all
Defined in:
lib/ra/pattern/gradient.rb

Overview

A graident pattern from color_a to color_b using:

color_b + (color_b - color_a) * (point.x - point.x.floor)

Instance Attribute Summary

Attributes inherited from Base

#transform

Instance Method Summary collapse

Methods inherited from Base

#color

Constructor Details

#initialize(color_a:, color_b:, transform: Transform::IDENTITY) ⇒ Gradient

Returns a new instance of Gradient.

Parameters:

  • color_a (Ra::Color)
  • color_b (Ra::Color)
  • transform (Ra::Matrix) (defaults to: Transform::IDENTITY)


12
13
14
15
16
# File 'lib/ra/pattern/gradient.rb', line 12

def initialize(color_a:, color_b:, transform: Transform::IDENTITY)
  super(transform:)
  @color_a = color_a
  @color_b = color_b
end