Skip to main content

RchTheme

Struct RchTheme 

Source
pub struct RchTheme;
Expand description

RCH brand colors and semantic styles.

§Design Philosophy

  • Purple: Compilation/build theme - sophisticated, technical
  • Cyan: Data transfer theme - clean, digital
  • Amber: Attention/highlights - warm, visible

§Example (with rich-ui feature)

use rch_common::ui::RchTheme;

let style = RchTheme::success();
// Use style with rich_rust Console

Implementations§

Source§

impl RchTheme

Source

pub const PRIMARY: &'static str = "#8B5CF6"

Primary brand color - Purple (compilation/build theme).

Source

pub const SECONDARY: &'static str = "#06B6D4"

Secondary brand color - Cyan (data/transfer theme).

Source

pub const ACCENT: &'static str = "#F59E0B"

Accent color - Amber (highlights, attention).

Source

pub const SUCCESS: &'static str = "#10B981"

Success state - Green.

Source

pub const WARNING: &'static str = "#F59E0B"

Warning state - Amber.

Source

pub const ERROR: &'static str = "#EF4444"

Error state - Red.

Source

pub const INFO: &'static str = "#3B82F6"

Informational - Blue.

Source

pub const STATUS_HEALTHY: &'static str = "#10B981"

Worker is healthy and accepting work - Green.

Source

pub const STATUS_DEGRADED: &'static str = "#F59E0B"

Worker is degraded (slow, high error rate) - Amber.

Source

pub const STATUS_UNREACHABLE: &'static str = "#EF4444"

Worker is unreachable (connection failed) - Red.

Source

pub const STATUS_DRAINING: &'static str = "#8B5CF6"

Worker is draining (no new work) - Purple.

Source

pub const STATUS_DRAINED: &'static str = "#6366F1"

Worker is drained (drain complete, idle) - Indigo.

Source

pub const STATUS_DISABLED: &'static str = "#737B8A"

Worker is disabled (admin disabled) - Gray.

Source

pub const MUTED: &'static str = "#9CA3AF"

Muted text (secondary information) - Gray-400.

Source

pub const DIM: &'static str = "#737B8A"

Dim text (tertiary information) - Gray-500.

Source

pub const BRIGHT: &'static str = "#F9FAFB"

Bright text (emphasis) - Gray-50.

Source

pub fn success() -> Style

Create style for success messages.

Source

pub fn error() -> Style

Create style for error messages (bold for emphasis).

Source

pub fn warning() -> Style

Create style for warning messages.

Source

pub fn info() -> Style

Create style for informational messages.

Source

pub fn muted() -> Style

Create style for muted/secondary text.

Source

pub fn dim() -> Style

Create style for dim/tertiary text.

Source

pub fn primary() -> Style

Create style for primary brand elements.

Source

pub fn secondary() -> Style

Create style for secondary brand elements.

Source

pub fn accent() -> Style

Create style for accent/highlight elements.

Source

pub fn worker_status_str(status: &str) -> Style

Create style for worker status based on string.

Source

pub fn for_worker_status(status: WorkerStatus) -> Style

Create style for worker status enum.

Source

pub fn table_header() -> Style

Style for table headers.

Source

pub fn table_border() -> Style

Style for table borders.

Source

pub fn panel_title() -> Style

Style for panel titles.

Source

pub fn code() -> Style

Style for command/code text.

Source

pub fn path() -> Style

Style for paths/filenames.

Source

pub fn number() -> Style

Style for numbers/metrics.

Source

pub const fn color_for_worker_status(status: WorkerStatus) -> &'static str

Get color hex code for a worker status.

Source

pub fn color_for_status_str(status: &str) -> &'static str

Get color hex code for a status string (case-insensitive).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more