add darken and brighten color fns

This commit is contained in:
2025-09-20 17:30:53 -04:00
parent 20b044865c
commit 01cec31da0
2 changed files with 46 additions and 35 deletions

View File

@@ -157,10 +157,10 @@ impl Client {
let rect = rect(color)
.id_on(Sense::click(), move |id, ctx: &mut Client, _| {
ctx.ui[main].inner.set_static(to);
ctx.ui[id].color = color.mul_rgb(0.7);
ctx.ui[id].color = color.darken(0.3);
})
.edit_on(Sense::HoverStart | Sense::unclick(), move |r, _| {
r.color = color.add_rgb(0.2);
r.color = color.brighten(0.2);
})
.edit_on(Sense::HoverEnd, move |r, _| {
r.color = color;