Class ColorExtensions
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
Color3The color.
colorSpace
ColorSpaceThe 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
Color3The color.
sourceColorSpace
ColorSpaceThe color space of this instance.
colorSpace
ColorSpaceThe 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
Color4The color.
colorSpace
ColorSpaceThe 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
Color4The color.
sourceColorSpace
ColorSpaceThe color space of this instance.
colorSpace
ColorSpaceThe 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
Returns
- Color
The color with the provided alpha value