use ratatui::style::{Color, Style};
use crate::theme;
use crate::theme::names::{gradients, styles, tokens};
use crate::theme::{
STYLE_AUTHOR, STYLE_COMMIT_HASH, STYLE_DIFF_ADDED, STYLE_DIFF_CONTEXT, STYLE_DIFF_HUNK,
STYLE_DIFF_REMOVED, STYLE_FILE_PATH, STYLE_GIT_DELETED, STYLE_GIT_MODIFIED, STYLE_GIT_STAGED,
STYLE_GIT_UNTRACKED, STYLE_MODE_INACTIVE, STYLE_TIMESTAMP,
};
pub fn commit_hash() -> Style {
theme::current().style(STYLE_COMMIT_HASH).into()
}
pub fn file_path() -> Style {
theme::current().style(STYLE_FILE_PATH).into()
}
pub fn keyword() -> Style {
theme::current().style(styles::KEYWORD).into()
}
pub fn line_number() -> Style {
theme::current().style(styles::LINE_NUMBER).into()
}
pub fn selected() -> Style {
theme::current().style(styles::SELECTED).into()
}
pub fn focused_border() -> Style {
theme::current().style(styles::FOCUSED_BORDER).into()
}
pub fn unfocused_border() -> Style {
theme::current().style(styles::UNFOCUSED_BORDER).into()
}
pub fn success() -> Style {
theme::current().style(styles::SUCCESS_STYLE).into()
}
pub fn error() -> Style {
theme::current().style(styles::ERROR_STYLE).into()
}
pub fn warning() -> Style {
theme::current().style(styles::WARNING_STYLE).into()
}
pub fn timestamp() -> Style {
theme::current().style(STYLE_TIMESTAMP).into()
}
pub fn author() -> Style {
theme::current().style(STYLE_AUTHOR).into()
}
pub fn dimmed() -> Style {
theme::current().style(styles::DIMMED).into()
}
pub fn inline_code() -> Style {
theme::current().style(styles::INLINE_CODE).into()
}
pub fn git_staged() -> Style {
theme::current().style(STYLE_GIT_STAGED).into()
}
pub fn git_modified() -> Style {
theme::current().style(STYLE_GIT_MODIFIED).into()
}
pub fn git_untracked() -> Style {
theme::current().style(STYLE_GIT_UNTRACKED).into()
}
pub fn git_deleted() -> Style {
theme::current().style(STYLE_GIT_DELETED).into()
}
pub fn diff_added() -> Style {
theme::current().style(STYLE_DIFF_ADDED).into()
}
pub fn diff_removed() -> Style {
theme::current().style(STYLE_DIFF_REMOVED).into()
}
pub fn diff_hunk() -> Style {
theme::current().style(STYLE_DIFF_HUNK).into()
}
pub fn diff_context() -> Style {
theme::current().style(STYLE_DIFF_CONTEXT).into()
}
pub fn accent_primary() -> Color {
theme::current().color(tokens::ACCENT_PRIMARY).into()
}
pub fn accent_secondary() -> Color {
theme::current().color(tokens::ACCENT_SECONDARY).into()
}
pub fn accent_tertiary() -> Color {
theme::current().color(tokens::ACCENT_TERTIARY).into()
}
pub fn warning_color() -> Color {
theme::current().color(tokens::WARNING).into()
}
pub fn success_color() -> Color {
theme::current().color(tokens::SUCCESS).into()
}
pub fn error_color() -> Color {
theme::current().color(tokens::ERROR).into()
}
pub fn text_primary_color() -> Color {
theme::current().color(tokens::TEXT_PRIMARY).into()
}
pub fn text_secondary_color() -> Color {
theme::current().color(tokens::TEXT_SECONDARY).into()
}
pub fn text_dim_color() -> Color {
theme::current().color(tokens::TEXT_DIM).into()
}
pub fn text_muted_color() -> Color {
theme::current().color(tokens::TEXT_MUTED).into()
}
pub fn bg_highlight_color() -> Color {
theme::current().color(tokens::BG_HIGHLIGHT).into()
}
pub fn bg_selection_color() -> Color {
theme::current().color(tokens::BG_SELECTION).into()
}
pub fn mode_inactive() -> Style {
theme::current().style(STYLE_MODE_INACTIVE).into()
}
pub fn gradient_purple_cyan(position: f32) -> Color {
theme::current()
.gradient(gradients::PRIMARY, position)
.into()
}
pub const SPINNER_BRAILLE: &[char] = &['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];