ColorExtensions Class
Namespace: Stride.GraphicsAssembly: Stride.dll
Extension class for Color
public static class ColorExtensions
| Name | Description | |
|---|---|---|
| Methods | ||
| ToColorSpace(Color3, ColorSpace) | Converts the color in gamma space to the specified ColorSpace. |
|
| ToColorSpace(Color3, ColorSpace, ColorSpace) | Converts the color from a particualr color space to the specified ColorSpace. |
|
| ToColorSpace(Color4, ColorSpace) | Converts the color in gamma space to the specified ColorSpace. |
|
| ToColorSpace(Color4, ColorSpace, ColorSpace) | Converts the color from a particualr color space to the specified ColorSpace. |
|
| WithAlpha(Color, Byte) | Create a copy of the color with the provided alpha value. |
|
Methods
ToColorSpace(Color3, ColorSpace)
Converts the color in gamma space to the specified ColorSpace.
public static Color3 ToColorSpace(this Color3 color, ColorSpace colorSpace)
Parameters
| Type | Name | Description |
|---|---|---|
| Color3 | color | The color. |
| ColorSpace | colorSpace | The color space. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Color3 | color | The color. |
| ColorSpace | sourceColorSpace | The color space of this instance. |
| ColorSpace | colorSpace | The color space. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Color4 | color | The color. |
| ColorSpace | colorSpace | The color space. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Color4 | color | The color. |
| ColorSpace | sourceColorSpace | The color space of this instance. |
| ColorSpace | colorSpace | The color space. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Color | color | The color to take as reference |
| System.Byte | alpha | The alpha value of the new color |
Returns
| Type | Description |
|---|---|
| Color | The color with the provided alpha value |