Add layered dawn wallpaper to shell background

Designs call for a radial-gradient dawn (cream base + pink upper-right
glow + blue lower-left glow). GPUI 0.2.2 only supports linear gradients,
so the wallpaper is composed of a cream base layer with two diagonal
linear gradients that fade to transparent at ~60% — the perceived effect
matches the design's softness without needing radial-gradient support.

Wallpaper is isolated to chrome::wallpaper so future appearance themes
(violet, mint, slate) extend the enum without touching the shell.
This commit is contained in:
2026-05-09 17:52:56 -04:00
parent 7dfefac569
commit dcd4bb4c48
4 changed files with 68 additions and 5 deletions
+3
View File
@@ -0,0 +1,3 @@
pub(crate) mod wallpaper;
pub(crate) use wallpaper::{WallpaperTheme, render_wallpaper};
@@ -0,0 +1,62 @@
use gpui::{
Hsla, IntoElement, ParentElement, Styled, div, hsla, linear_color_stop, linear_gradient, rgb,
};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum WallpaperTheme {
Dawn,
}
impl WallpaperTheme {
fn base(self) -> u32 {
match self {
Self::Dawn => 0xefe8e1,
}
}
fn upper_blob(self) -> Hsla {
match self {
Self::Dawn => hsla(351.0 / 360.0, 1.0, 0.91, 0.85),
}
}
fn lower_blob(self) -> Hsla {
match self {
Self::Dawn => hsla(228.0 / 360.0, 1.0, 0.86, 0.65),
}
}
}
pub(crate) fn render_wallpaper(theme: WallpaperTheme) -> impl IntoElement {
let upper = theme.upper_blob();
let lower = theme.lower_blob();
div()
.absolute()
.inset_0()
.bg(rgb(theme.base()))
.child(
div()
.absolute()
.inset_0()
.bg(linear_gradient(
225.0,
linear_color_stop(upper, 0.0),
linear_color_stop(transparent_like(upper), 0.55),
)),
)
.child(
div()
.absolute()
.inset_0()
.bg(linear_gradient(
45.0,
linear_color_stop(lower, 0.0),
linear_color_stop(transparent_like(lower), 0.62),
)),
)
}
fn transparent_like(color: Hsla) -> Hsla {
hsla(color.h, color.s, color.l, 0.0)
}