mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
more accurate doc
This commit is contained in:
1 parent
e6e4a86546
commit
521e5a12fd
1 file changed
+2
-2
@@ -8,10 +8,10 @@ namespace MiraAPI.Utilities;
|
||||
public static class ColorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the relative luminance of a color (WCAG 2.1 specification).
|
||||
/// Gets the relative luminance of a color (WCAG 2.1 specification). 0 is black, 1 is white.
|
||||
/// </summary>
|
||||
/// <param name="color">Color to calculate luminance for.</param>
|
||||
/// <returns>Relative luminance value.</returns>
|
||||
/// <returns>Luminance value between 0 and 1.</returns>
|
||||
public static float GetRelativeLuminance(this Color color)
|
||||
{
|
||||
var r = color.r <= 0.03928f ? color.r / 12.92f : Mathf.Pow((color.r + 0.055f) / 1.055f, 2.4f);
|
||||
|
||||
Reference in new issue
Block a user