sw/source/core/access/AccessibilityCheck.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 02e2870c86a00380549266f944c9218187a002ec
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Aug 20 16:31:36 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Aug 21 12:12:30 2024 +0200

    sw: 0.03928 -> 0.04045
    
    According to https://www.w3.org/TR/WCAG21/#dfn-relative-luminance:
    "Before May 2021 the value of 0.04045 in the definition was different
    (0.03928). It was taken from an older version of the specification and
    has been updated."
    
    Change-Id: I7cd7c0ee3e0d04795c7db9d93053e159e011fc62
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172146
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 6708fc7f615e..28e8cd21ab38 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -677,9 +677,9 @@ double calculateRelativeLuminance(Color const& rColor)
     double b = aBColor.getBlue();
 
     // Calculate the values according to the described algorithm
-    r = (r <= 0.03928) ? r / 12.92 : std::pow((r + 0.055) / 1.055, 2.4);
-    g = (g <= 0.03928) ? g / 12.92 : std::pow((g + 0.055) / 1.055, 2.4);
-    b = (b <= 0.03928) ? b / 12.92 : std::pow((b + 0.055) / 1.055, 2.4);
+    r = (r <= 0.04045) ? r / 12.92 : std::pow((r + 0.055) / 1.055, 2.4);
+    g = (g <= 0.04045) ? g / 12.92 : std::pow((g + 0.055) / 1.055, 2.4);
+    b = (b <= 0.04045) ? b / 12.92 : std::pow((b + 0.055) / 1.055, 2.4);
 
     return 0.2126 * r + 0.7152 * g + 0.0722 * b;
 }

Reply via email to