https://bugs.freedesktop.org/show_bug.cgi?id=61993

--- Comment #3 from Luke <[email protected]> ---
Word 2010 appears to treat a background colour as "dark" if:

130*red + 255*green * 51*blue < 105*255

Where red, green, blue are the RGB components of the background colour as 8-bit
integers (ie in the range 0 to 255).

(I arrived at this formula by:
- collecting some data points by experimentation with Word 2010
- guessing the form of this formula
- using linear algebra with the data points to work out the coefficients
- double-checking using more data points)

By comparison, LibreOffice treats a background colour as "dark" if:

28*red + 151*green + 77*blue <= 38*256

(see Color::IsDark() in tools/source/generic/color.cxx, called from
SwDrawTextInfo::ApplyAutoColor in sw/source/core/txtnode/fntcache.cxx)

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to