Table of Contents

Class ColorExtensions

Namespace
Stride.Graphics
Assembly
Stride.dll

Extension class for Color

public static class ColorExtensions
Inheritance
ColorExtensions

Methods

ToColorSpace(Color3, ColorSpace)

Converts the color in gamma space to the specified ColorSpace.

public static Color3 ToColorSpace(this Color3 color, ColorSpace colorSpace)

Parameters

color Color3

The color.

colorSpace ColorSpace

The color space.

Returns

Color3

The color converted to the specified color space.

ToColorSpace(Color3, ColorSpace, ColorSpace)

Converts the color from a particualr color space to the specified ColorSpace.

public static Color3 ToColorSpace(this Color3 color, ColorSpace sourceColorSpace, ColorSpace colorSpace)

Parameters

color Color3

The color.

sourceColorSpace ColorSpace

The color space of this instance.

colorSpace ColorSpace

The color space.

Returns

Color3

The color converted to the specified color space.

ToColorSpace(Color4, ColorSpace)

Converts the color in gamma space to the specified ColorSpace.

public static Color4 ToColorSpace(this Color4 color, ColorSpace colorSpace)

Parameters

color Color4

The color.

colorSpace ColorSpace

The color space.

Returns

Color4

The color converted to the specified color space.

ToColorSpace(Color4, ColorSpace, ColorSpace)

Converts the color from a particualr color space to the specified ColorSpace.

public static Color4 ToColorSpace(this Color4 color, ColorSpace sourceColorSpace, ColorSpace colorSpace)

Parameters

color Color4

The color.

sourceColorSpace ColorSpace

The color space of this instance.

colorSpace ColorSpace

The color space.

Returns

Color4

The color converted to the specified color space.

WithAlpha(Color, byte)

Create a copy of the color with the provided alpha value.

public static Color WithAlpha(this Color color, byte alpha)

Parameters

color Color

The color to take as reference

alpha byte

The alpha value of the new color

Returns

Color

The color with the provided alpha value