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

New commits:
commit f0ca7d889f2b0d149c9f7df0ee2ab236ee11ae12
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Aug 20 16:31:36 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Aug 21 14:23:29 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>
    (cherry picked from commit 02e2870c86a00380549266f944c9218187a002ec)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172187

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 429b94a02efb..a035715ee3c2 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -479,9 +479,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