banner
Startup banner molecule with gradient ASCII art and optional author/version lines.
const ASCII_ART
const ASCII_ART: [&str; 6] = [
" ██████╗ ███████╗███████╗████████╗",
"██╔════╝ ██╔════╝██╔════╝╚══██╔══╝",
"██║ ███╗█████╗ ███████╗ ██║",
"██║ ██║██╔══╝ ╚════██║ ██║",
"╚██████╔╝███████╗███████║ ██║",
" ╚═════╝ ╚══════╝╚══════╝ ╚═╝",
];ASCII block-art rows for the GEST logo.
const ROW_COUNT
const ROW_COUNT: usize = ASCII_ART.len();Total number of rows in the ASCII art, used to compute gradient interpolation.
const SHADOW_CHARS
const SHADOW_CHARS: &[char] = &['╗', '╚', '╝', '╔', '║'];Box-drawing characters rendered with the shadow color for depth effect.
struct Component
pub struct ComponentRenders the application startup banner with gradient ASCII art and optional author and version lines.
| Field | Type | Description |
|---|---|---|
show_author |
bool | Whether to print the by @aaronmallen line under the art. |
show_version |
bool | Whether to print the version, platform, build date and git revision line. |
Implements Display.
Component::new
pub fn new() -> SelfCreate a banner with no optional lines enabled.
| Parameter | Type | Description |
|---|---|---|
| returns | Self | A banner that shows only the ASCII art. |
Component::with_version
pub fn with_version(self) -> SelfEnable the version info line beneath the ASCII art.
| Parameter | Type | Description |
|---|---|---|
| returns | Self | The banner with the version line on. |
fn fg_color
fn fg_color(style: &Style) -> ColorExtracts the foreground color from a style, defaulting to white.
| Parameter | Type | Description |
|---|---|---|
style |
&Style | the theme style to read |
| returns | Color | Its foreground color, or Color::White when it has none. |
fn lerp_color
fn lerp_color(start: Color, end: Color, t: f32) -> ColorLinearly interpolates between two RGB colors. Falls back to start for non-RGB variants.
| Parameter | Type | Description |
|---|---|---|
start |
Color | the color at t = 0 |
end |
Color | the color at t = 1 |
t |
f32 | the position between them, from 0 to 1 |
| returns | Color | The blended color, each channel truncated to a whole number; start unless both colors are RGB. |