Class: RGhost::Gray

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

Overview

Creates Gray color

Constant Summary

Constants included from RubyToPs

RubyToPs::UTF8_ENCODINGS

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



163
164
165
# File 'lib/rghost/color.rb', line 163

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

Instance Attribute Details

#grayObject

Returns the value of attribute gray.



157
158
159
# File 'lib/rghost/color.rb', line 157

def gray
  @gray
end

Instance Method Details

#psObject

:nodoc:



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

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