Show / Hide Table of Contents

Class XYZColor

Contains helper-methods and extension for the Color-type to work in the XYZ color space.

Inheritance
object
XYZColor
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public static class XYZColor

Methods

| Edit this page View Source

AddXYZ(in Color, float, float, float)

Adds the specified XYZ values to this color.

Declaration
public static Color AddXYZ(this in Color color, float x = 0, float y = 0, float z = 0)
Parameters
Type Name Description
Color color

The color to modify.

float x

The X value to add.

float y

The Y value to add.

float z

The Z value to add.

Returns
Type Description
Color

The new color after the modification.

| Edit this page View Source

Create(byte, float, float, float)

Creates a new instance of the Color struct using alpha and XYZ-Values.

Declaration
public static Color Create(byte a, float x, float y, float z)
Parameters
Type Name Description
byte a

The alpha component value of this Color.

float x

The X component value of this Color.

float y

The Y component value of this Color.

float z

The Z component value of this Color.

Returns
Type Description
Color

The color created from the values.

| Edit this page View Source

Create(int, float, float, float)

Creates a new instance of the Color struct using alpha and XYZ-Values.

Declaration
public static Color Create(int a, float x, float y, float z)
Parameters
Type Name Description
int a

The alpha component value of this Color.

float x

The X component value of this Color.

float y

The Y component value of this Color.

float z

The Z component value of this Color.

Returns
Type Description
Color

The color created from the values.

| Edit this page View Source

Create(float, float, float)

Creates a new instance of the Color struct using XYZ-Values.

Declaration
public static Color Create(float x, float y, float z)
Parameters
Type Name Description
float x

The X component value of this Color.

float y

The Y component value of this Color.

float z

The Z component value of this Color.

Returns
Type Description
Color

The color created from the values.

| Edit this page View Source

Create(float, float, float, float)

Creates a new instance of the Color struct using alpha and XYZ-Values.

Declaration
public static Color Create(float a, float x, float y, float z)
Parameters
Type Name Description
float a

The alpha component value of this Color.

float x

The X component value of this Color.

float y

The Y component value of this Color.

float z

The Z component value of this Color.

Returns
Type Description
Color

The color created from the values.

| Edit this page View Source

DivideXYZ(in Color, float, float, float)

Divides the specified XYZ values to this color.

Declaration
public static Color DivideXYZ(this in Color color, float x = 1, float y = 1, float z = 1)
Parameters
Type Name Description
Color color

The color to modify.

float x

The X value to divide.

float y

The Y value to divide.

float z

The Z value to divide.

Returns
Type Description
Color

The new color after the modification.

| Edit this page View Source

GetX(in Color)

Gets the X component value (XYZ-color space) of this Color in the range [0..95.047].

Declaration
public static float GetX(this in Color color)
Parameters
Type Name Description
Color color

The color to get the value from.

Returns
Type Description
float

The X component value of the color.

| Edit this page View Source

GetXYZ(in Color)

Gets the X, Y and Z component values (XYZ-color space) of this Color. X in the range [0..95.047]. Y in the range [0..100]. Z in the range [0..108.883].

Declaration
public static (float x, float y, float z) GetXYZ(this in Color color)
Parameters
Type Name Description
Color color

The color to get the value from.

Returns
Type Description
(float r, float g, float b)

A tuple containing the X, Y and Z component value of the color.

| Edit this page View Source

GetY(in Color)

Gets the Y component value (XYZ-color space) of this Color in the range [0..100].

Declaration
public static float GetY(this in Color color)
Parameters
Type Name Description
Color color

The color to get the value from.

Returns
Type Description
float

The Y component value of the color.

| Edit this page View Source

GetZ(in Color)

Gets the Z component value (XYZ-color space) of this Color in the range [0..108.883].

Declaration
public static float GetZ(this in Color color)
Parameters
Type Name Description
Color color

The color to get the value from.

Returns
Type Description
float

The Z component value of the color.

| Edit this page View Source

MultiplyXYZ(in Color, float, float, float)

Multiplies the specified XYZ values to this color.

Declaration
public static Color MultiplyXYZ(this in Color color, float x = 1, float y = 1, float z = 1)
Parameters
Type Name Description
Color color

The color to modify.

float x

The X value to multiply.

float y

The Y value to multiply.

float z

The Z value to multiply.

Returns
Type Description
Color

The new color after the modification.

| Edit this page View Source

SetXYZ(in Color, float?, float?, float?)

Sets the specified X valueof this color.

Declaration
public static Color SetXYZ(this in Color color, float? x = null, float? y = null, float? z = null)
Parameters
Type Name Description
Color color

The color to modify.

float? x

The X value to set.

float? y

The Y value to set.

float? z

The Z value to set.

Returns
Type Description
Color

The new color after the modification.

| Edit this page View Source

SubtractXYZ(in Color, float, float, float)

Subtracts the specified XYZ values to this color.

Declaration
public static Color SubtractXYZ(this in Color color, float x = 0, float y = 0, float z = 0)
Parameters
Type Name Description
Color color

The color to modify.

float x

The X value to subtract.

float y

The Y value to subtract.

float z

The Z value to subtract.

Returns
Type Description
Color

The new color after the modification.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX