class CTioga2::Graphics::Styles::FillPattern

This class handles drawing the pattern in a fill.

It is a base class.

Add transparency !

Public Class Methods

from_text(str) click to toggle source
# File lib/ctioga2/graphics/styles/fill.rb, line 44
def self.from_text(str)
  els = str.split(/\s*:\s*/)
  args = []
  if els.size > 1
    args = els[1].split(/\s*,\s*/)
  end
  
  case els[0]
  when /^hlines$/i
    return SingleLineFillPattern.new(0, *args)
  when /^vlines$/i
    return SingleLineFillPattern.new(90, *args)
  when /^lines$/i
    return SingleLineFillPattern.new(*args)
  when /^xlines$/i
    return CrossedLinesFillPattern.new(*args)
  when /^(solid|plain)$/i
    return false
  end
end

Public Instance Methods

do(t, color, secondary = nil) click to toggle source

Draws the pattern over the whole output, with primary color color and secondary color secondary (not implemented yet).

This does nothing. Derived classes do the job

# File lib/ctioga2/graphics/styles/fill.rb, line 41
def do(t, color, secondary = nil)
end