darken to use lab color

This commit is contained in:
Will McGugan
2022-04-06 11:10:43 +01:00
parent 9cf32fac28
commit 575de6e741
2 changed files with 4 additions and 9 deletions

View File

@@ -38,12 +38,7 @@ class BasicApp(App):
content=Widget(
Tweet(TweetHeader(), TweetBody(), Widget(classes={"button"})),
Tweet(TweetHeader(), TweetBody()),
Tweet(TweetHeader(), TweetBody())
# Tweet(TweetHeader(), TweetBody()),
# Tweet(TweetHeader(), TweetBody()),
# Tweet(TweetHeader(), TweetBody()),
# Tweet(TweetHeader(), TweetBody()),
# Tweet(TweetHeader(), TweetBody()),
Tweet(TweetHeader(), TweetBody()),
),
footer=Widget(),
sidebar=Widget(

View File

@@ -300,9 +300,9 @@ class Color(NamedTuple):
Returns:
Color: New color.
"""
h, l, s = self.hls
color = self.from_hls(h, l - amount, s)
return color.clamped
l, a, b = rgb_to_lab(self)
l -= amount * 100
return lab_to_rgb(Lab(l, a, b))
def lighten(self, amount: float) -> Color:
"""Lighten the color by a given amount.