diff --git a/crates/modules/tahuantinsuyu/tahuantinsuyu-canvas/src/lib.rs b/crates/modules/tahuantinsuyu/tahuantinsuyu-canvas/src/lib.rs index b0b6d4e..6d1f23c 100644 --- a/crates/modules/tahuantinsuyu/tahuantinsuyu-canvas/src/lib.rs +++ b/crates/modules/tahuantinsuyu/tahuantinsuyu-canvas/src/lib.rs @@ -36,8 +36,8 @@ use std::f32::consts::PI; use gpui::{ AppContext, Bounds, Context, EventEmitter, FocusHandle, Focusable, Hsla, IntoElement, KeyDownEvent, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, ParentElement, - PathBuilder, Pixels, Point, Render, SharedString, Styled, Window, canvas, div, hsla, point, - prelude::*, px, + PathBuilder, Pixels, Point, Render, SharedString, Styled, Window, canvas, div, hsla, + linear_color_stop, linear_gradient, point, prelude::*, px, }; use tahuantinsuyu_engine::{Geometry, Layer, LayerKind, RenderModel}; @@ -486,10 +486,22 @@ fn render_wheel( .w(px(WHEEL_SIZE)) .h(px(WHEEL_SIZE)); + // Gradient sutil diagonal en el fondo del wheel — toque "místico + // velado": alpha muy baja, así no compite con la geometría pintada + // encima pero llena las zonas vacías (esquinas del cuadrado, gaps + // entre anillos) con un shimmer mineral. + let wheel_bg = linear_gradient( + 155.0, + linear_color_stop(with_alpha(palette.dial_ring, 0.06), 0.0), + linear_color_stop(with_alpha(palette.angle_highlight, 0.03), 1.0), + ); + let mut wheel = div() .relative() .w(px(WHEEL_SIZE)) .h(px(WHEEL_SIZE)) + .bg(wheel_bg) + .rounded(px(12.0)) .child(canvas_element); // Sign glyphs. @@ -945,16 +957,21 @@ fn paint_wheel( } // 4. Dots de cuerpos: natal en `bodies`, overlays en sus rings - // específicos (progression, solar_arc). + // específicos (progression, solar_arc). Las luminarias natales + // (Sol/Luna) llevan glow halo — invita la mística sin saturar. if show(LayerKind::Bodies) { let dot_r = (radii.sign_outer * 0.018).max(2.0); for layer in layers { if matches!(layer.kind, LayerKind::Bodies) { let ring = radii.body_ring(&layer.module_id); - let alpha = if layer.module_id == "natal" { 1.0 } else { 0.85 }; + let is_natal = layer.module_id == "natal"; + let alpha = if is_natal { 1.0 } else { 0.85 }; for g in &layer.glyphs { let color = with_alpha(planet_color(palette, &g.symbol), alpha); let (x, y) = polar_to_screen(g.deg, ascendant_deg, rot_offset_deg, ring); + if is_natal && (g.symbol == "sun" || g.symbol == "moon") { + paint_glow(window, cx + x, cy + y, dot_r, color); + } fill_circle(window, cx + x, cy + y, dot_r, color); } } @@ -1093,6 +1110,19 @@ fn stroke_circle(window: &mut Window, cx: f32, cy: f32, r: f32, width: f32, colo } } +/// Pinta 3 halos concéntricos con alpha decreciente alrededor de un +/// punto — usado para Sol/Luna natales. El radio crece, la opacidad +/// cae: el ojo lo lee como "esto irradia". Sin glow real (GPUI 0.2 no +/// tiene radial gradient), pero el shading concéntrico convence. +fn paint_glow(window: &mut Window, cx: f32, cy: f32, base_r: f32, color: Hsla) { + const HALOS: [(f32, f32); 3] = [(5.0, 0.05), (3.0, 0.12), (1.8, 0.22)]; + for (mult, alpha) in HALOS { + let r = base_r * mult; + let halo = hsla(color.h, color.s, color.l, alpha); + fill_circle(window, cx, cy, r, halo); + } +} + fn fill_circle(window: &mut Window, cx: f32, cy: f32, r: f32, color: Hsla) { const SEGMENTS: usize = 32; let mut builder = PathBuilder::fill();