Class: RGhost::Gray

Inherits:
Color show all
Defined in:
lib/rghost/color.rb

Overview

Creates Gray color

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Color

create

Methods included from RubyToPs

#array_to_stack, #hash_to_array, #pack_string, #ps_escape, #string_eval, #to_array, #to_bool, #to_string, #to_string_array

Methods inherited from PsObject

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

Constructor Details

#initialize(gray = 0.8) ⇒ Gray

A single Numeric Color.create 0.5 50 percent of black will be divided by 100.0 Color.create 50



166
167
168
# File 'lib/rghost/color.rb', line 166

def initialize(gray=0.8)
  @gray=gray
end

Instance Attribute Details

#grayObject

Returns the value of attribute gray.



160
161
162
# File 'lib/rghost/color.rb', line 160

def gray
  @gray
end

Instance Method Details

#psObject

:nodoc:



170
171
172
173
# File 'lib/rghost/color.rb', line 170

def ps #:nodoc:
  @gray = @gray/100.0 if @gray > 1
  "#{@gray} setgray"
end