Package gameobjects :: Module color :: Class ColorRGBA
[hide private]
[frames] | no frames]

Class ColorRGBA

source code


Instance Methods [hide private]
 
__init__(self, *args)
Creates a color object.
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
copy(self)
Returns a copy of the color object.
source code
 
__copy__(self)
Returns a copy of the color object.
source code
 
_get_r(self) source code
 
_set_r(self, r) source code
 
_get_g(self) source code
 
_set_g(self, g) source code
 
_get_b(self) source code
 
_set_b(self, b) source code
 
_get_a(self) source code
 
_set_a(self, a) source code
 
_get_rgba8(self) source code
 
_set_rgba8(self, rgba) source code
 
_get_rgb8(self) source code
 
_set_rgb8(self, rgb) source code
 
__len__(self) source code
 
__iter__(self) source code
 
__getitem__(self, index) source code
 
__setitem__(self, index, value) source code
 
__eq__(self, rhs) source code
 
__ne__(self, rhs) source code
 
__hash__(self)
hash(x)
source code
 
__add__(self, rhs) source code
 
__iadd__(self, rhs) source code
 
__radd__(self, lhs) source code
 
__sub__(self, rhs) source code
 
__isub__(self, rhs) source code
 
__rsub__(self, lhs) source code
 
__mul__(self, rhs) source code
 
__imul__(self, rhs) source code
 
__rmul__(self, lhs) source code
 
__div__(self, rhs) source code
 
__idiv__(self, rhs) source code
 
__rdiv__(self, lhs) source code
 
__neg__(self) source code
 
__pos__(self) source code
 
__nonzero__(self) source code
 
__call__(self, keys) source code
 
as_tuple(self) source code
 
as_tuple_rgb(self) source code
 
as_tuple_rgba(self) source code
 
__int__(self)
Convert the color to a packed RGBA integer.
source code
 
as_html(self)
Returns the color encoded as an html style string.
source code
 
saturate(self)
Saturates the color, so that all components are in the range 0->1
source code
 
get_saturate(self)
Returns the saturated color as a copy.
source code
 
invert(self)
Inverts the color.
source code
 
get_inverse(self)
Gets the inverse of the color.
source code
 
mul_alpha(self)
Multiplies the color by its alpha component.
source code

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
black(cls)
Create a color object representing black.
source code
 
white(cls)
Create a color object representing white.
source code
 
from_floats(cls, r, g, b, a=1.0)
Creates a color object from float components.
source code
 
from_rgba8(cls, r, g, b, a=255.0)
Creates a color object from 4 integer components in 0->255 range.
source code
 
from_html(cls, col_str, a=1.0)
Creates a color object from an html style color string.
source code
 
grey(self, level)
Creates a 'grey' color.
source code
 
gray(self, level)
Creates a 'grey' color.
source code
 
from_palette(cls, color_name) source code
Properties [hide private]
  r
Red component.
  g
Green component.
  b
Blue component.
  a
Alpha component.
  rgba8
RGBA integer 8 bit format
  rgb8
RGB integer 8 bit format
  _c

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 
Creates a color object.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

from_floats(cls, r, g, b, a=1.0)
Class Method

source code 

Creates a color object from float components.

r -- Red component g -- Green component b -- Blue component a -- Alpha component

from_rgba8(cls, r, g, b, a=255.0)
Class Method

source code 

Creates a color object from 4 integer components in 0->255 range.

r -- Red component g -- Green component b -- Blue component a -- Alpha component

from_html(cls, col_str, a=1.0)
Class Method

source code 

Creates a color object from an html style color string.

col_str -- The color string (eg. "#FF0000")

grey(self, level)
Class Method

source code 

Creates a 'grey' color.

level -- Grey level (0 is black, 1. is 'full' white)

gray(self, level)
Class Method

source code 

Creates a 'grey' color.

level -- Grey level (0 is black, 1. is 'full' white)

__hash__(self)
(Hashing function)

source code 
hash(x)
Overrides: object.__hash__
(inherited documentation)

Property Details [hide private]

r

Red component.
Get Method:
gameobjects.color.ColorRGBA._get_r(self)
Set Method:
gameobjects.color.ColorRGBA._set_r(self, r)

g

Green component.
Get Method:
gameobjects.color.ColorRGBA._get_g(self)
Set Method:
gameobjects.color.ColorRGBA._set_g(self, g)

b

Blue component.
Get Method:
gameobjects.color.ColorRGBA._get_b(self)
Set Method:
gameobjects.color.ColorRGBA._set_b(self, b)

a

Alpha component.
Get Method:
gameobjects.color.ColorRGBA._get_a(self)
Set Method:
gameobjects.color.ColorRGBA._set_a(self, a)

rgba8

RGBA integer 8 bit format
Get Method:
gameobjects.color.ColorRGBA._get_rgba8(self)
Set Method:
gameobjects.color.ColorRGBA._set_rgba8(self, rgba)

rgb8

RGB integer 8 bit format
Get Method:
gameobjects.color.ColorRGBA._get_rgb8(self)
Set Method:
gameobjects.color.ColorRGBA._set_rgb8(self, rgb)