mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
darken to use lab color
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user