]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Correct the implementation of bulmaColorBrightness
authorBen Anderson <ben@delivereasy.co.nz>
Tue, 11 Jun 2024 03:25:27 +0000 (15:25 +1200)
committerBen Anderson <ben@delivereasy.co.nz>
Tue, 11 Jun 2024 03:34:34 +0000 (15:34 +1200)
Instead of using all channels of the colour to approximate brightness,
this function was sublty ignoring the blue channel and over-stating
other channels.

sass/utilities/functions.scss

index f19dae06b89568a0e90fee09dd7c1c463bc6f4a5..4fdefe835df7c460e9879f7c79beb44f00ba9e3a 100644 (file)
 
 @function bulmaColorBrightness($n) {
   $color-brightness: round(
-    (red($n) * 299) + (green($n) * 587) + (blue($n) * 114) / 1000
+   ((red($n) * 299) + (green($n) * 587) + (blue($n) * 114)) / 1000
   );
   $light-color: round(
-    (red(#ffffff) * 299) + (green(#ffffff) * 587) + (blue(#ffffff) * 114) / 1000
+    ((red(#ffffff) * 299) + (green(#ffffff) * 587) + (blue(#ffffff) * 114)) / 1000
   );
 
   @if abs($color-brightness) < math.div($light-color, 2) {