@@ -1827,20 +1827,17 @@ def hash_str(string, pos):
1827
1827
def degreediff (dega , degb ):
1828
1828
return min (abs (dega - degb ), abs ((degb - dega ) + 360 ))
1829
1829
1830
- def husl_similar_from_base (string , base_color ):
1831
- if husl is None :
1832
- req_missing (['husl' ], 'Use color mixing (section colors)' ,
1833
- optional = True )
1834
- return base_color
1835
- h , s , l = husl .hex_to_husl (base_color )
1836
- old_h = h
1837
- idx = 0
1838
- while degreediff (old_h , h ) < 27 and idx < 16 :
1839
- h = 360.0 * (float (hash_str (string , idx )) / 255 )
1840
- idx += 1
1841
- return husl .husl_to_hex (h , s , l )
1842
-
1843
- return husl_similar_from_base (string , base_color )
1830
+ if husl is None :
1831
+ req_missing (['husl' ], 'Use color mixing (section colors)' ,
1832
+ optional = True )
1833
+ return base_color
1834
+ h , s , l = husl .hex_to_husl (base_color )
1835
+ old_h = h
1836
+ idx = 0
1837
+ while degreediff (old_h , h ) < 27 and idx < 16 :
1838
+ h = 360.0 * (float (hash_str (string , idx )) / 255 )
1839
+ idx += 1
1840
+ return husl .husl_to_hex (h , s , l )
1844
1841
1845
1842
1846
1843
def color_hsl_adjust_hex (hexstr , adjust_h = None , adjust_s = None , adjust_l = None ):
0 commit comments