Skip to content

Commit

Permalink
BUG: Pass integers to Bokeh RGB constructor (#1164)
Browse files Browse the repository at this point in the history
* roudning error in RGB functionality

* Update backtesting/_plotting.py
  • Loading branch information
Murat-U-Saglam authored Jan 22, 2025
1 parent 5a59c4e commit b2cd457
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backtesting/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def colorgen():
def lightness(color, lightness=.94):
rgb = np.array([color.r, color.g, color.b]) / 255
h, _, s = rgb_to_hls(*rgb)
rgb = np.array(hls_to_rgb(h, lightness, s)) * 255.
rgb = (np.array(hls_to_rgb(h, lightness, s)) * 255).astype(int)
return RGB(*rgb)


Expand Down

0 comments on commit b2cd457

Please sign in to comment.