ColorExtensionsGetBrightnessF(Color32) Method

Gets the brightness of a Color32 instance as a float value based on human perception. The A component of the specified value is ignored.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.1.0
C#
public static float GetBrightnessF(
	this Color32 c
)

Parameters

c  Color32
The Color32 instance to get the brightness of.

Return Value

Single
A float value where 0 represents the darkest and 1 represents the brightest possible value.

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).

Remarks

  Note

This method always returns a gamma corrected result. To get the brightness in the linear color space use the GetBrightness(ColorF) method instead.

See Also