Skip to content

Commit

Permalink
iss #381 replaced validate_coverage_threshold with lines of code
Browse files Browse the repository at this point in the history
  • Loading branch information
BiancaMorandi committed May 16, 2023
1 parent 4dfe414 commit 207fcce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion brightwind/analyse/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ def _adjust_color_lightness(input_color, lightness_factor):
:return: color in hex format
:rtype: hex
"""
lightness_factor = utils.validate_coverage_threshold(lightness_factor)

lightness_factor = 0 if lightness_factor is None else lightness_factor
if lightness_factor < 0 or lightness_factor > 1:
raise TypeError("Invalid lightness_factor, this should be between or equal to 0 and 1.")

r, g, b = tuple(255 * np.array(mpl.colors.to_rgb(input_color))) # convert to rgb format
hue, lightness, saturation = rgb2hls(r / 255.0, g / 255.0, b / 255.0)
r, g, b = hls2rgb(hue, lightness_factor, saturation)
Expand Down

0 comments on commit 207fcce

Please sign in to comment.