maxon.Col3¶
Description¶
maxon.Data
class.maxon.DataType
).Attributes¶
The blue component |
|
The green component |
|
The red component |
Methods Signature¶
|
Returns a vector that is clamped to the range [0.0 . |
Calculates the average value of ‘r’, ‘g’, ‘b’. |
|
|
Returns the maximum of ‘r’, ‘g’, ‘b’. |
|
Return the minimum of ‘r’, ‘g’, ‘b’. |
|
Tests component-wise if the difference is no bigger than ‘epsilon’. |
|
Checks if each component is zero. |
|
Converts the data to the expected type (built-in). |
|
Sets all components to zero. |
|
Adds another color to the current color. |
|
Divides each color component by a scalar. |
|
Checks if two colors are equal. |
|
Retrieves the value of the r, g or b component of the color.
|
|
Returns the hash code of a color. |
|
Adds another color to the current color. |
|
Divides each color component by a scalar. |
|
Multiplies each color components by the scalar and returns the color result. |
|
Initializes a new three component color.
|
|
Subtracts another color to the current color. |
|
Iterates color values in the next order: r, g, b. |
|
|
|
Multiplies each color components by the scalar and returns the color result. |
|
Checks if two colors are not equal. |
|
Assigns a value to the r, g or b component of the color.
|
|
Returns the string representation of a data. |
|
Subtracts another color to the current color. |
Methods Definition¶
-
Col3.
Clamp01
()¶ Returns a vector that is clamped to the range [0.0 .. 1.0].
- Returns
The color clamped.
- Return type
-
Col3.
GetAverage
()¶ Calculates the average value of ‘r’, ‘g’, ‘b’.
- Returns
the average value.
- Return type
float
-
Col3.
GetMax
()¶ Returns the maximum of ‘r’, ‘g’, ‘b’.
- Returns
The maximum value.
- Returns
float
-
Col3.
GetMin
()¶ Return the minimum of ‘r’, ‘g’, ‘b’.
- Returns
The minimum value.
- Returns
float
-
Col3.
IsEqual
(other, epsilon=0.01)¶ Tests component-wise if the difference is no bigger than ‘epsilon’.
- Parameters
other (
maxon.Col3
) – The other color to compare with.epsilon (float) – The tolerance value.
- Returns
True if both color are identical.
- Return type
bool
-
Col3.
IsZero
()¶ Checks if each component is zero.
- Returns
True if all component is zero.
- Return type
bool
-
Col3.
MaxonConvert
(expected=None)¶ Converts the data to the expected type (built-in).
- Parameters
expected (Any) – The expected type after the conversion.
- Returns
The data converted.
- Return type
Same as expected
-
Col3.
SetZero
()¶ Sets all components to zero.
-
Col3.
__add__
(scalar)¶ Adds another color to the current color.
- Parameters
scalar (
maxon.Col3
) – The other color.- Return type
- Returns
The resulting color.
-
Col3.
__div__
(scalar)¶ Divides each color component by a scalar.
- Parameters
scalar (Union[int, float]) – The other operand.
- Return type
- Returns
The resulting color.
-
Col3.
__eq__
(other)¶ Checks if two colors are equal.
- Parameters
other (
maxon.Col3
) – The other color.- Return type
bool
- Returns
True if colors are equal.
-
Col3.
__getitem__
(index)¶ - Retrieves the value of the r, g or b component of the color.The component is identified by an index in the interval [0, 2].
- Parameters
index (int) – The component index.
- Raises
IndexError – When index does not satisfy 0 <= index < 2.
- Return type
float
- Returns
The color component.
-
Col3.
__hash__
()¶ Returns the hash code of a color.
-
Col3.
__iadd__
(other)¶ Adds another color to the current color.
- Parameters
other (
maxon.Col3
) – The other color.- Return type
- Returns
The resulting color.
-
Col3.
__idiv__
(scalar)¶ Divides each color component by a scalar.
- Parameters
scalar (Union[int, float]) – The other operand.
- Return type
- Returns
The resulting color.
-
Col3.
__imul__
(scalar)¶ Multiplies each color components by the scalar and returns the color result.
- Parameters
scalar (float) – The other color.
- Return type
- Returns
The resulting color.
-
Col3.
__init__
(r=None, g=None, b=None)¶ - Initializes a new three component color.It is possible to instantiate a new color without any arguments, causing the r, g, bcomponents to default to the value 0. The type can otherwise be instantiated with one orthree arguments, either setting all components to the same value, or setting themindividually.
- ..note:
This type should not be instantiated directly, use instead the type
maxon.Color
.
- Parameters
r (Optional[number]) – If r is the only passed argument, set this to R/G/B components. Otherwise, set the red component.
g (Optional[number]) – The green component. Can only be passed if b is also defined.
b (Optional[number]) – The blue component.
- Return type
- Returns
A new
maxon.Col3
.
-
Col3.
__isub__
(other)¶ Subtracts another color to the current color.
- Parameters
other (
maxon.Col3
) – The other color.- Return type
- Returns
The resulting color.
-
Col3.
__iter__
()¶ Iterates color values in the next order: r, g, b.
-
Col3.
__maxon_convert__
(expected=None)¶
-
Col3.
__mul__
(scalar)¶ Multiplies each color components by the scalar and returns the color result.
- Parameters
scalar (float) – The other color.
- Return type
- Returns
The resulting color.
-
Col3.
__ne__
(other)¶ Checks if two colors are not equal.
- Parameters
other (
maxon.Col3
) – The other color.- Return type
bool
- Returns
True if both colors are not equal.
-
Col3.
__setitem__
(index, value)¶ - Assigns a value to the r, g or b component of the color.The component is identified by an index in the interval [0, 2].
- Parameters
index (int) – The index to which the value should be assigned.
value (float) – The value to assign for the given index.
-
Col3.
__str__
()¶ Returns the string representation of a data.
- Return type
str
-
Col3.
__sub__
(scalar)¶ Subtracts another color to the current color.
- Parameters
scalar (
maxon.Col3
) – The other color.- Return type
- Returns
The resulting color.