File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2
2
import re
3
3
import sys
4
4
import warnings
5
+ from colorsys import hls_to_rgb , rgb_to_hls
5
6
from itertools import cycle , combinations
6
7
from functools import partial
7
8
from typing import Callable , List , Union
8
9
9
10
import numpy as np
10
11
import pandas as pd
11
12
13
+ from bokeh .colors import RGB
12
14
from bokeh .colors .named import (
13
15
lime as BULL_COLOR ,
14
16
tomato as BEAR_COLOR
@@ -81,9 +83,10 @@ def colorgen():
81
83
82
84
83
85
def lightness (color , lightness = .94 ):
84
- color = color .to_hsl ()
85
- color .l = lightness # noqa
86
- return color .to_rgb ()
86
+ rgb = np .array ([color .r , color .g , color .b ]) / 255
87
+ h , _ , s = rgb_to_hls (* rgb )
88
+ rgb = np .array (hls_to_rgb (h , lightness , s )) * 255
89
+ return RGB (* rgb )
87
90
88
91
89
92
_MAX_CANDLES = 10_000
You can’t perform that action at this time.
0 commit comments