ColorExtensionsToGray(Color32, WorkingColorSpace) Method

Converts the specified color to a grayscale color using the specified colorSpace.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public static Color32 ToGray(
	this Color32 c,
	WorkingColorSpace colorSpace
)

Parameters

c  Color32
The color to convert to grayscale.
colorSpace  WorkingColorSpace
The working color space to be used to determine the shade of the result. If Default, then this overload uses the sRGB color space. For performance reasons this method does not validate this parameter. For undefined values the sRGB color space will be used as well.

Return Value

Color32
A Color32 instance representing the grayscale version of the input color.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Color32. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also