Package omero :: Package gateway :: Class ColorHolder
[hide private]
[frames] | no frames]

Class ColorHolder

source code


Stores color internally as (R,G,B,A) and allows setting and getting in multiple formats

Instance Methods [hide private]
 
__init__(self, colorname=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
getRed(self) source code
 
setRed(self, val)
Set red, as int 0..255
source code
 
getGreen(self) source code
 
setGreen(self, val)
Set green, as int 0..255
source code
 
getBlue(self) source code
 
setBlue(self, val)
Set Blue, as int 0..255
source code
 
getAlpha(self) source code
 
setAlpha(self, val)
Set alpha, as int 0..255.
source code
 
getHtml(self)
Returns: String.
source code
 
getCss(self)
Returns: String.
source code
 
getRGB(self)
Returns: list.
source code

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

Class Methods [hide private]
 
fromRGBA(klass, r, g, b, a) source code
Class Variables [hide private]
  _color = {'red': 0, 'green': 0, 'blue': 0, 'alpha': 255}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, colorname=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

setRed(self, val)

source code 

Set red, as int 0..255

Parameters:
  • val - value of Red.

setGreen(self, val)

source code 

Set green, as int 0..255

Parameters:
  • val - value of Green.

setBlue(self, val)

source code 

Set Blue, as int 0..255

Parameters:
  • val - value of Blue.

setAlpha(self, val)

source code 

Set alpha, as int 0..255.

Parameters:
  • val - value of alpha.

getHtml(self)

source code 
Returns:
String. The html usable color. Dumps the alpha information.

getCss(self)

source code 
Returns:
String. rgba(r,g,b,a) for this color.

getRGB(self)

source code 
Returns:
list. A list of (r,g,b) values