Package pyscript :: Module base :: Class Color
[show private | hide private]
[frames | no frames]

Class Color

object --+    
         |    
     PsObj --+
             |
            Color


Class to encode a postscript color

There are five ways to specify the color:
Method Summary
  __init__(self, *col, **options)
Initialisation of the colour object
  __mul__(self, other)
colors can be multiplied by a numeric factor.
  body(self)
Returns the body of the postscript for the Color object
    Inherited from PsObj
self __call__(self, **options)
Set a whole lot of attributes in one go
string __repr__(self)
Return a representation of this object
string __str__(self)
return actual postscript string to generate object
Bbox bbox(self)
return objects bounding box this can be a Null Bbox() if object doesn't draw anything on the page.)
self copy(self, **options)
return a copy of this object with listed attributes modified
string postbody(self)
convenience function to allow clean subclassing
string prebody(self)
convenience function to allow clean subclassing
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Class Variable Summary
dict COLORS = {'indigo': (75, 0, 130), 'gold': (255, 215, 0),...

Method Details

__init__(self, *col, **options)
(Constructor)

Initialisation of the colour object
Parameters:
col -
           (type=)
options -
           (type=)
Overrides:
pyscript.base.PsObj.__init__

__mul__(self, other)

colors can be multiplied by a numeric factor. factors less than 1 will darken the colors, factors grater than will will lighten the colors. (this depends on how the colors where specified)

eg:
 Color(.2,.6,.6)*.5 = Color(.1,.3,.3)

body(self)

Returns the body of the postscript for the Color object
Overrides:
pyscript.base.PsObj.body

Class Variable Details

COLORS

Type:
dict
Value:
{'darkolivegreen': (85, 107, 47),
 'darkseagreen': (143, 188, 143),
 'darkslategrey': (47, 79, 79),
 'firebrick': (178, 34, 34),
 'gold': (255, 215, 0),
 'indianred': (205, 92, 92),
 'indigo': (75, 0, 130),
 'slategrey': (112, 128, 144),
...                                                                    

Generated by Epydoc 2.0 on Mon Apr 24 17:02:35 2006 http://epydoc.sf.net