vaab / colour

Python color representations manipulation library (RGB, HSL, web, ...)
BSD 2-Clause "Simplified" License
319 stars 41 forks source link

fixed problem in range_to when hue should've cycled. #48

Open alexhagen opened 5 years ago

alexhagen commented 5 years ago

Previously, when performing range_to on colors with hues that crossed 1.0, the color_scale function used in range_to would go through all intervening hues instead of crossing 1.0. For example, when going from purple with hue 0.94 to red with hue 0.04, range_to returned almost all colors (blue, green, yellow) by ranging from 0.94 downward to 0.04 instead of going from 0.94 to 1.0 and then restarting at 0.0 and going to 0.4. This commit fixes that.

codecov[bot] commented 5 years ago

Codecov Report

Merging #48 into master will decrease coverage by 2.32%. The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   99.13%   96.81%   -2.33%     
==========================================
  Files           1        1              
  Lines         232      251      +19     
==========================================
+ Hits          230      243      +13     
- Misses          2        8       +6
Impacted Files Coverage Δ
colour.py 96.81% <88%> (-2.33%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 11f138e...8a6a0cb. Read the comment docs.