AeroOS / kernel /src /graphics /wallpaper.rs
Jaswanth-2008's picture
Upload AeroOS complete Rust source code
dcbeeb2 verified
Raw History Blame Contribute Delete
917 Bytes
use crate::graphics::color::Color;
use crate::graphics::surface::Surface;
pub fn render_wallpaper(surface: &mut Surface) {
let w = surface.width;
let h = surface.height;
// Authentic Windows 11 Bloom & macOS Monterey Atmosphere
// Deep Midnight Sapphire (#0e1c34) -> Royal Cobalt (#183e76) -> Electric Azure (#2563eb) -> Deep Slate (#0f172a)
let h1 = (h * 35) / 100;
let h2 = (h * 70) / 100;
surface.draw_gradient_v(0, 0, w, h1, Color::rgb(14, 28, 52), Color::rgb(24, 62, 118));
surface.draw_gradient_v(0, h1 as i32, w, h2 - h1, Color::rgb(24, 62, 118), Color::rgb(37, 99, 235));
surface.draw_gradient_v(0, h2 as i32, w, h - h2, Color::rgb(37, 99, 235), Color::rgb(15, 23, 42));
// Soft celestial light arc at horizon
surface.draw_rect(0, h1 as i32, w, 1, Color::rgba(147, 197, 253, 50));
surface.draw_rect(0, h1 as i32 + 1, w, 1, Color::rgba(96, 165, 250, 25));
}