Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/bokeh/colors/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ class HSL(Color):
'''

def __init__(self, h: float, s: float, l: float, a: float = 1.0) -> None:
'''
"""


Args:
h (int) :
Expand All @@ -399,19 +400,20 @@ def __init__(self, h: float, s: float, l: float, a: float = 1.0) -> None:
a (float, optional) :
An alpha value for this color in [0, 1] (default: 1.0)

'''
"""
self.h = h
self.s = s
self.l = l
self.a = a

def copy(self) -> HSL:
''' Return a copy of this color value.
""" Return a copy of this color value.


Returns:
:class:`~bokeh.colors.HSL`

'''
"""
return HSL(self.h, self.s, self.l, self.a)

def darken(self, amount: float) -> HSL:
Expand Down Expand Up @@ -468,13 +470,15 @@ def to_css(self) -> str:
return f"hsla({self.h}, {self.s*100}%, {self.l*100}%, {self.a})"

def to_hsl(self) -> HSL:
''' Return a HSL copy for this HSL color.
""" Return a HSL copy for this HSL color.


Returns:
:class:`~bokeh.colors.HSL`

'''
return self.copy()
"""
# Directly construct; avoids indirection of extra method call
return HSL(self.h, self.s, self.l, self.a)

def to_rgb(self) -> RGB:
''' Return a corresponding :class:`~bokeh.colors.RGB` color for
Expand Down