use macroquad::color::Color;
use macroquad::math::Vec2;
use macroquad::miniquad::window::screen_size;
use macroquad::prelude::draw_rectangle;

pub fn screen_center() -> Vec2 {
    Vec2::from(screen_size()) * 0.5
}

pub fn draw_rectangle_with_border(
    rect_pos: Vec2,
    rect_size: Vec2,
    border_width: f32,
    fg_color: Color,
    bg_color: Color,
) {
    let border_pos = rect_pos - border_width;
    let border_size = rect_size + 2.0 * border_width;

    draw_rectangle(
        border_pos.x,
        border_pos.y,
        border_size.x,
        border_size.y,
        bg_color,
    );
    draw_rectangle(rect_pos.x, rect_pos.y, rect_size.x, rect_size.y, fg_color);
}
