beyonder-gpu 0.1.0

GPU-accelerated renderer for the Beyond terminal
Documentation
//! Renderer for ApprovalRequest blocks.
//! These are the security dialogs — rendered with attention-grabbing amber accent.

use super::render_block_background;
use crate::pipeline::RectInstance;
use beyonder_core::Block;

pub fn render_approval_block(
    block: &Block,
    x: f32,
    y: f32,
    width: f32,
    height: f32,
    scale: f32,
    rects: &mut Vec<RectInstance>,
) {
    render_block_background(block, x, y, width, height, rects);

    // Yellow #f9e2af stripe — attention signal
    rects.push(
        RectInstance::filled(x, y, 4.0 * scale, height, [0.976, 0.886, 0.686, 1.0])
            .with_radius(scale * 2.0),
    );

    // Header bar — dark Yellow tint
    rects.push(
        RectInstance::filled(
            x + scale,
            y + scale,
            width - scale * 2.0,
            26.0 * scale,
            [0.200, 0.170, 0.088, 1.0],
        )
        .with_radius(2.0 * scale),
    );

    // Approve (Green dark) / Deny (Red dark) buttons
    let btn_y = y + height - 32.0 * scale;
    let btn_w = 90.0 * scale;
    let btn_h = 24.0 * scale;
    let btn_r = 4.0 * scale;
    let gap = 10.0 * scale;
    rects.push(
        RectInstance::filled(x + gap, btn_y, btn_w, btn_h, [0.210, 0.500, 0.245, 1.0])
            .with_radius(btn_r),
    );
    rects.push(
        RectInstance::filled(
            x + gap + btn_w + gap,
            btn_y,
            btn_w,
            btn_h,
            [0.530, 0.165, 0.220, 1.0],
        )
        .with_radius(btn_r),
    );
}