Class: RGhost::ShapeContent

Inherits:
PsObject show all
Defined in:
lib/rghost/shape_content.rb

Overview

Responsible for fill shapes

Constant Summary collapse

DEFAULT_OPTIONS =
{
  :fill => true, :color => "#F0FFFF"
  
}

Instance Method Summary collapse

Methods inherited from PsObject

#<<, #call, #graphic_scope, #raw, #set, #to_s

Constructor Details

#initialize(options = {}) ⇒ ShapeContent

You can use parameter :color(facade for Color.create) or disable using :fill => false



9
10
11
12
# File 'lib/rghost/shape_content.rb', line 9

def initialize(options={})
  super(""){}
  @options = DEFAULT_OPTIONS.dup.merge(options)
end

Instance Method Details

#psObject



14
15
16
17
18
19
20
21
# File 'lib/rghost/shape_content.rb', line 14

def ps
  p=RGhost::PsObject.new
  p.raw :gsave
  p.set RGhost::Color.create(@options[:color])  if @options[:color]
  p.raw :fill if @options[:fill]
  p.raw :grestore
  p
end