Struct LinearRgb
Represents an linear Rgb color with specified RgbWorkingSpace working space
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.ColorSpaces
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct LinearRgb : IEquatable<LinearRgb>
Constructors
| Edit this page View SourceLinearRgb(Vector3)
Initializes a new instance of the LinearRgb struct.
Declaration
public LinearRgb(Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector representing the r, g, b components. |
LinearRgb(Vector3, RgbWorkingSpace)
Initializes a new instance of the LinearRgb struct.
Declaration
public LinearRgb(Vector3 vector, RgbWorkingSpace workingSpace)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector representing the r, g, b components. |
RgbWorkingSpace | workingSpace | The LinearRgb working space. |
LinearRgb(float, float, float)
Initializes a new instance of the LinearRgb struct.
Declaration
public LinearRgb(float r, float g, float b)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component ranging between 0 and 1. |
float | g | The green component ranging between 0 and 1. |
float | b | The blue component ranging between 0 and 1. |
LinearRgb(float, float, float, RgbWorkingSpace)
Initializes a new instance of the LinearRgb struct.
Declaration
public LinearRgb(float r, float g, float b, RgbWorkingSpace workingSpace)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component ranging between 0 and 1. |
float | g | The green component ranging between 0 and 1. |
float | b | The blue component ranging between 0 and 1. |
RgbWorkingSpace | workingSpace | The rgb working space. |
Fields
| Edit this page View SourceDefaultWorkingSpace
The default LinearRgb working space.
Declaration
public static readonly RgbWorkingSpace DefaultWorkingSpace
Field Value
Type | Description |
---|---|
RgbWorkingSpace |
Properties
| Edit this page View SourceB
Gets the blue component.
Declaration
public float B { get; }
Property Value
Type | Description |
---|---|
float |
G
Gets the green component.
Declaration
public float G { get; }
Property Value
Type | Description |
---|---|
float |
R
Gets the red component.
Declaration
public float R { get; }
Property Value
Type | Description |
---|---|
float |
WorkingSpace
Gets the LinearRgb color space RgbWorkingSpaces
Declaration
public RgbWorkingSpace WorkingSpace { get; }
Property Value
Type | Description |
---|---|
RgbWorkingSpace |
Methods
| Edit this page View SourceEquals(LinearRgb)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(LinearRgb other)
Parameters
Type | Name | Description |
---|---|---|
LinearRgb | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
| Edit this page View SourceToVector3()
Returns a new Vector3 representing this instance.
Declaration
public Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | The Vector3. |
Operators
| Edit this page View Sourceoperator ==(LinearRgb, LinearRgb)
Compares two LinearRgb objects for equality.
Declaration
public static bool operator ==(LinearRgb left, LinearRgb right)
Parameters
Type | Name | Description |
---|---|---|
LinearRgb | left | The LinearRgb on the left side of the operand. |
LinearRgb | right | The LinearRgb on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | True if the current left is equal to the |
operator !=(LinearRgb, LinearRgb)
Compares two LinearRgb objects for inequality.
Declaration
public static bool operator !=(LinearRgb left, LinearRgb right)
Parameters
Type | Name | Description |
---|---|---|
LinearRgb | left | The LinearRgb on the left side of the operand. |
LinearRgb | right | The LinearRgb on the right side of the operand. |
Returns
Type | Description |
---|---|
bool | True if the current left is unequal to the |