Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Math.Color.Color Class Reference

An RGBA color value. More...

Public Member Functions

None __init__ (self, Union[int, float] r=0, Union[int, float] g=0, Union[int, float] b=0, Union[int, float] a=0)
 
 r (self)
 
 setR (self, value)
 
 g (self)
 
 setG (self, value)
 
 b (self)
 
 setB (self, value)
 
 a (self)
 
 setA (self, value)
 
 setValues (self, r, g, b, a)
 
 __eq__ (self, other)
 
 __hash__ (self)
 
 __repr__ (self)
 
 toHexString (self, include_alpha=False)
 Returns a 7-character string in "#RRGGBB" format representing the color.
 

Static Public Member Functions

 fromARGB (value)
 Returns a new Color constructed from a 32-bit integer in ARGB order.
 
 fromHexString (value)
 Returns a new Color constructed from a 7- or 9-character string "#RRGGBB" or "#AARRGGBB" format.
 

Protected Attributes

 _r
 
 _g
 
 _b
 
 _a
 

Detailed Description

An RGBA color value.

This class represents an RGBA color value, in the range of 0.0 to 1.0.

Member Function Documentation

◆ fromARGB()

UM.Math.Color.Color.fromARGB (   value)
static

Returns a new Color constructed from a 32-bit integer in ARGB order.

Parameters
valueA 32-bit integer representing a color in ARGB order.
Returns
A Color constructed from the components of value.

◆ fromHexString()

UM.Math.Color.Color.fromHexString (   value)
static

Returns a new Color constructed from a 7- or 9-character string "#RRGGBB" or "#AARRGGBB" format.

Parameters
valueA 7- or 9-character string representing a color in "#RRGGBB" or "#AARRGGBB" format.
Returns
A Color constructed from the components of value.

◆ toHexString()

UM.Math.Color.Color.toHexString (   self,
  include_alpha = False 
)

Returns a 7-character string in "#RRGGBB" format representing the color.

Parameters
include_alphaWhether to return a 7-character "#RRGGBB" or a 9 character "#AARRGGBB" format.
Returns
A 7- or 9-character string representing a color in "#AARRGGBB" format.

The documentation for this class was generated from the following file: