Package esys :: Package lsm :: Package vis :: Package core :: Module color :: Class RgbColor
[hide private]
[frames] | no frames]

Class RgbColor

object --+
         |
        RgbColor
Known Subclasses:

Represents a named color as a (red, green, blue) tuple.

Instance Methods [hide private]
 
__init__(self, red, green, blue, name=None)
Initialises a color object.
 
__len__(self)
 
__getitem__(self, i)
tuple
getRgb(self)
Returns red, green and blue intensities as a (r,g,b) tuple.
str
getName(self)
Returns the name associated with this color.
 
setName(self, name)
Sets the name associated with this color.
 
__mul__(self, fraction)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, red, green, blue, name=None)
(Constructor)

 

Initialises a color object.

Parameters:
  • red (float) - Red value between 0.0 and 1.0 inclusive.
  • green (float) - Green value between 0.0 and 1.0 inclusive.
  • blue (float) - Blue value between 0.0 and 1.0 inclusive.
  • name (str) - The name assigned to this color object.
Overrides: object.__init__

getRgb(self)

 

Returns red, green and blue intensities as a (r,g,b) tuple.

Returns: tuple
(r,g,b) tuple.

getName(self)

 

Returns the name associated with this color.

Returns: str
The name associated with this color.

setName(self, name)

 

Sets the name associated with this color.

Parameters:
  • name (str) - Name assigned to this color.