ColorExtensionsGetBrightnessF(Color32, WorkingColorSpace) 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.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.2.0
public static float GetBrightnessF(
this Color32 c,
WorkingColorSpace colorSpace
)
<ExtensionAttribute>
Public Shared Function GetBrightnessF (
c As Color32,
colorSpace As WorkingColorSpace
) As Single
public:
[ExtensionAttribute]
static float GetBrightnessF(
Color32 c,
WorkingColorSpace colorSpace
)
[<ExtensionAttribute>]
static member GetBrightnessF :
c : Color32 *
colorSpace : WorkingColorSpace -> float32
- c Color32
- The Color32 instance to get the brightness of.
- colorSpace WorkingColorSpace
- The color space to be used for determining the brightness. If Default, then the sRGB color space will be used.
For performance reasons this method does not validate this parameter. For undefined values the sRGB color space will be used as well.
SingleA
float value where 0 represents the darkest and 1 represents the brightest possible value.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).