about summary refs log tree commit diff
path: root/lib/paperclip
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-02-03 18:57:38 +0100
committerGitHub <noreply@github.com>2021-02-03 18:57:38 +0100
commit4ed9576cd28abc033a094fed6babe9825014f1af (patch)
treed6d5e7b07e24248da5c237726dca874727c10b38 /lib/paperclip
parent7632255115a7f6e6f9f8047f0d0d1b90d7ee9315 (diff)
parente1fa06c459a28a575d0da540432c61b702e99cdd (diff)
Merge pull request #1496 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'lib/paperclip')
-rw-r--r--lib/paperclip/color_extractor.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/paperclip/color_extractor.rb b/lib/paperclip/color_extractor.rb
index a70a3d21f..d3b8e1022 100644
--- a/lib/paperclip/color_extractor.rb
+++ b/lib/paperclip/color_extractor.rb
@@ -55,7 +55,7 @@ module Paperclip
       # If we don't have enough colors for accent and foreground, generate
       # new ones by manipulating the background color
       (2 - foreground_colors.size).times do |i|
-        foreground_colors << lighten_or_darken(background_color, 35 + (15 * i))
+        foreground_colors << lighten_or_darken(background_color, 35 + (i * 15))
       end
 
       # We want the color with the highest contrast to background to be the foreground one,
@@ -147,7 +147,7 @@ module Paperclip
         g = l.to_f
         b = l.to_f # achromatic
       else
-        q = l < 0.5 ? l * (1 + s) : l + s - l * s
+        q = l < 0.5 ? l * (s + 1) : l + s - l * s
         p = 2 * l - q
         r = hue_to_rgb(p, q, h + 1 / 3.0)
         g = hue_to_rgb(p, q, h)