feat(tahuantinsuyu): fase 16 — polish místico (gradient sutil + glow en luminarias)
Dos toques pequeños que dan profundidad visual sin saturar: 1. **Gradient diagonal en el fondo del wheel**: linear_gradient 155° desde palette.dial_ring @ alpha 0.06 hasta palette.angle_highlight @ alpha 0.03. La opacidad mínima asegura que no compite con la geometría pintada encima; el efecto se ve sobre todo en las esquinas del cuadrado (afuera del círculo) y en los gaps entre anillos cuando no hay overlays. Da "shimmer mineral" muy velado. El wheel además ahora tiene rounded(12px) — perfila el cuadrado sin que se sienta como un container. 2. **Glow halo en luminarias natales**: paint_glow nuevo helper que pinta 3 fill_circle concéntricos con (radius × 5/3/1.8, alpha 0.05/0.12/0.22). Aplicado solo a Sol y Luna del layer natal — son los puntos psicológicamente cargados y los que el ojo busca primero. El resto de planetas mantiene su dot limpio. GPUI 0.2 no tiene radial_gradient nativo así que el shading concéntrico discreto cubre el rol. - canvas: imports linear_color_stop + linear_gradient. paint_glow() helper. Loop de Bodies en paint_wheel detecta is_natal && (sun|moon) → paint_glow antes del fill_circle del dot. Convive con todo lo anterior: si la luminaria está oculta (toggle [P] off), el glow también; si hay overlays con sus propios planetas, solo las luminarias natales lucen halo (diferenciable de su contraparte en transit/synastry/return). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user