Struct Color
Linear RGB color without alpha channel.
Implements
Inherited Members
Namespace: Unity.Cloud.Gltfast.Objects
Assembly: Unity.Cloud.Gltfast.dll
Syntax
public struct Color : IEquatable<Color>
Constructors
Color(float, float, float)
Creates a new Color.
Declaration
public Color(float r, float g, float b)
Parameters
| Type | Name | Description |
|---|---|---|
| float | r | Red component. |
| float | g | Green component. |
| float | b | Blue component. |
Properties
B
Blue component.
Declaration
public float B { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Black
Opaque black color (0, 0, 0).
Declaration
public static Color Black { get; }
Property Value
| Type | Description |
|---|---|
| Color |
G
Green component.
Declaration
public float G { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
MaxColorComponent
Returns the maximum color component value: Max(r,g,b).
Declaration
[JsonIgnore]
public float MaxColorComponent { get; }
Property Value
| Type | Description |
|---|---|
| float |
R
Red component.
Declaration
public float R { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
White
Opaque white color (1, 1, 1).
Declaration
public static Color White { get; }
Property Value
| Type | Description |
|---|---|
| Color |
Methods
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Equals(Color)
Declaration
public bool Equals(Color other)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
Operators
operator ==(Color, Color)
Component-wise equality with floating point tolerance of epsilon.
Declaration
public static bool operator ==(Color a, Color b)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | a | First color. |
| Color | b | Second color. |
Returns
| Type | Description |
|---|---|
| bool | True if all components match within tolerance. |
implicit operator Color(Color)
Implicit conversion to Color. Alpha defaults to 1.
Declaration
public static implicit operator Color(Color c)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | c | Source color. |
Returns
| Type | Description |
|---|---|
| Color | Unity Color. |
implicit operator Color(Color)
Implicit conversion from Color. Alpha is dropped.
Declaration
public static implicit operator Color(Color c)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | c | Source color. |
Returns
| Type | Description |
|---|---|
| Color | glTF Color. |
operator !=(Color, Color)
Component-wise inequality with floating point tolerance of epsilon.
Declaration
public static bool operator !=(Color a, Color b)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | a | First color. |
| Color | b | Second color. |
Returns
| Type | Description |
|---|---|
| bool | True if any component differs beyond tolerance. |