Skip to content

Fix scaleColor and adjustColor from ColorUtils

Bart De Vries requested to merge work/mogwai/fix-colorutils into master

Both methods had multiple issues:

  • Both methods were reading Color::value() but then reassigning the updated value to Color::setHsl() instead of Color::setHsv(). This was leading to very different colors than expected.
  • Next, adjustColor was applying any passed alpha value as absolute value for the new alpha instead of applying it as a delta, which is what happens to all the other properties.
  • The alpha adjustment for scaleColor is now applied separatly, so it also gets applied if rgb deltas are specified, and not only with hsv values.

Merge request reports