Struct LinearRgb
- Namespace
- SixLabors.ImageSharp.ColorSpaces
- Assembly
- SixLabors.ImageSharp.dll
Represents an linear Rgb color with specified RgbWorkingSpace working space
public readonly struct LinearRgb : IEquatable<LinearRgb>
- Implements
- Inherited Members
Constructors
LinearRgb(Vector3)
Initializes a new instance of the LinearRgb struct.
public LinearRgb(Vector3 vector)
Parameters
vector
Vector3The vector representing the r, g, b components.
LinearRgb(Vector3, RgbWorkingSpace)
Initializes a new instance of the LinearRgb struct.
public LinearRgb(Vector3 vector, RgbWorkingSpace workingSpace)
Parameters
vector
Vector3The vector representing the r, g, b components.
workingSpace
RgbWorkingSpaceThe LinearRgb working space.
LinearRgb(float, float, float)
Initializes a new instance of the LinearRgb struct.
public LinearRgb(float r, float g, float b)
Parameters
r
floatThe red component ranging between 0 and 1.
g
floatThe green component ranging between 0 and 1.
b
floatThe blue component ranging between 0 and 1.
LinearRgb(float, float, float, RgbWorkingSpace)
Initializes a new instance of the LinearRgb struct.
public LinearRgb(float r, float g, float b, RgbWorkingSpace workingSpace)
Parameters
r
floatThe red component ranging between 0 and 1.
g
floatThe green component ranging between 0 and 1.
b
floatThe blue component ranging between 0 and 1.
workingSpace
RgbWorkingSpaceThe rgb working space.
Fields
DefaultWorkingSpace
The default LinearRgb working space.
public static readonly RgbWorkingSpace DefaultWorkingSpace
Field Value
Properties
B
Gets the blue component.
public float B { get; }
Property Value
G
Gets the green component.
public float G { get; }
Property Value
R
Gets the red component.
public float R { get; }
Property Value
WorkingSpace
Gets the LinearRgb color space RgbWorkingSpaces
public RgbWorkingSpace WorkingSpace { get; }
Property Value
Methods
Equals(LinearRgb)
public bool Equals(LinearRgb other)
Parameters
other
LinearRgb
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
ToVector3()
Returns a new Vector3 representing this instance.
public Vector3 ToVector3()
Returns
Operators
operator ==(LinearRgb, LinearRgb)
Compares two LinearRgb objects for equality.
public static bool operator ==(LinearRgb left, LinearRgb right)
Parameters
left
LinearRgbThe LinearRgb on the left side of the operand.
right
LinearRgbThe LinearRgb on the right side of the operand.
Returns
- bool
True if the current left is equal to the
right
parameter; otherwise, false.
operator !=(LinearRgb, LinearRgb)
Compares two LinearRgb objects for inequality.
public static bool operator !=(LinearRgb left, LinearRgb right)
Parameters
left
LinearRgbThe LinearRgb on the left side of the operand.
right
LinearRgbThe LinearRgb on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
right
parameter; otherwise, false.