ColorExtensionsGetBrightness(ColorF, WorkingColorSpace) Method

Gets the brightness of a ColorF instance as a float value in the linear color space. The A component of the specified value is ignored.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.1.1
C#
public static float GetBrightness(
	this ColorF c,
	WorkingColorSpace colorSpace
)

Parameters

c  ColorF
The Color64 instance to get the brightness of.
colorSpace  WorkingColorSpace
The color space to be used for determining the brightness. If Default, then the linear color space will be used. For performance reasons this method does not validate this parameter. For undefined values the linear color space will be used as well.

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

See Also