Skip to content

Changelog

0.7.1farben
2026-03-16
Added
  • style!() — moved from farben-core. Defines a named style in the global registry. Gated behind the format feature.
  • prefix!() — moved from farben-core. Sets a prefix string on a previously defined named style. Gated behind the format feature.
0.6.1farben-core
2026-03-16
Changed
  • style!() — moved to farben. Users importing directly from farben-core should update to farben::style!().
  • prefix!() — moved to farben. Users importing directly from farben-core should update to farben::prefix!().
0.3.1farben-macros
2026-03-16
Changed
  • Minor dependency update to farben-core.
0.3.0farben-macros
2026-03-16
Changed
  • colorb! — replaced one-line stub doc with a full doc comment explaining what bleed means, when to use it, and how it differs from color!. Includes a working example.
  • validate_color! — removed misleading user-facing example. Doc comment now explicitly marks it as internal and directs users toward color! and color_fmt!.
0.7.0farben
2026-03-16
Added
  • colorb — added missing doc comment explaining bleed behavior and when to use it over color.
  • color_fmt! (compile-time variant) — added missing doc comment. Previously the runtime variant was documented but the compile-feature counterpart had none.
Changed
  • Crate-level doc comment revised: fixed grammar and capitalized "German".
Fixed
  • cprint! (compile-time variant) — example referenced unbound variable message. Added declaration so it compiles as a doctest.
  • cprintln! (compile-time variant) — example referenced unbound variable result. Added declaration so it compiles as a doctest.
  • test_try_color_inline_reset — strengthened assertion to a full equality check against the expected output "\x1b[31mbefore\x1b[0mafter\x1b[0m".
0.6.0farben-core
2026-03-16
Added
  • LexError::InvalidResetTarget — returned when a reset tag targets something that cannot be reset (e.g. [//] or [/prefix]). Previously caused a panic.
  • LexError::UnknownStyle — returned by registry::set_prefix when the given style name has not been registered.
  • registry::set_prefix now returns Result<(), LexError> instead of (), allowing callers to handle unknown style names without panicking.
Changed
  • ansi::style_to_ansi promoted from pub(crate) to pub. Users building on top of farben-core can now call it directly.
  • ansi::style_to_ansi — removed #[allow(unused)] now that it is part of the public API.
  • registry::prefix! macro updated to call .expect() on the Result returned by set_prefix, preserving panic-on-misuse at the macro callsite.
  • LexError::InvalidArgumentCount display improved from "expected N, got M" to "expected N arguments, got M".
Fixed
  • lexer::parse_part — replaced panic! with Err(LexError::InvalidResetTarget) when a reset tag targets a Reset or Prefix node.
  • registry::set_prefix — replaced panic! with Err(LexError::UnknownStyle) when the style name is not found in the registry.
  • errors.rs — corrected typo in UnclosedValue display: "parantheses" → "parentheses".
  • ansi::NamedColor doc comment — corrected "eight standard ANSI named colors" to "sixteen ANSI named colors".
  • ansi::style_to_ansi — added a working doctest demonstrating bold + named color output.
  • parser::render — removed unnecessary .as_str() calls on String return values.
0.6.0farben-core (cascade)
2026-03-16
Added
  • Specified resets — [/bold], [/red], [/italic] etc. reset only the named style, leaving all other active styles intact.
  • TagType::Reset now takes Option<Box<TagType>>None for full reset [/], Some(tag) for partial reset.
  • parser::render now maintains an active tag stack, re-emitting surviving styles after a partial reset.
Changed
  • TagType::Reset changed from a unit variant to Reset(Option<Box<TagType>>).
  • All existing [/] full reset behavior is preserved via Reset(None).
Fixed
  • Fixed a bug where colorb!() did not exist when using the compile feature.
0.2.6farben / farben-macros
2026-03-16
Changed
  • Minor dependency update to farben-core.
0.5.1farben
2026-03-16
Changed
  • Minor dependency update to farben-core.
0.2.5farben-macros
2026-03-15
Changed
  • Minor dependency update to farben-core.
0.4.2farben-core
2026-03-15
Added
  • Bright ANSI color variants (bright-black through bright-white).
0.5.0farben-core (cascade)
2026-03-15
Added
  • Added bugs.
  • Style::prefix field — optional text prepended before the style's ANSI codes when applied.
  • TagType::Prefix(String) variant — carries prefix text through the token pipeline to the renderer.
  • set_prefix() — sets the prefix on an existing registry entry, panics if the style is not found.
  • prefix!() macro — user-facing API for binding a text prefix to a named style.
  • style_to_tags() now emits TagType::Prefix as the first tag when a prefix is present.
  • parser::render() now handles TagType::Prefix by appending the text directly to output.
  • format default feature — gates logic for style!() and prefix!().
Changed
  • style_to_tags() no longer returns early on reset when a prefix is present; prefix is always emitted first.
  • style!() is now gated to the format feature.
0.4.1farben-core
2026-03-15
Fixed
  • Bug where prefix!() interfered with actual color styling.
0.2.4farben-macros
2026-03-15
Changed
  • Minor dependency update to farben-core.
0.2.3farben-macros
2026-03-15
Changed
  • Minor dependency update to farben-core.
0.4.0farben-core (cascade)
Public Farben Update2026-03-15
Added
  • Style::parse() — builds a Style from a farben markup string.
  • Style::reset field — when true, overrides all other style attributes with a full SGR reset.
  • registry module — global style registry backed by OnceLock<Mutex<HashMap<String, Style>>>.
  • insert_style() — inserts a named style into the global registry.
  • search_registry() — looks up a named style from the global registry.
  • style!() macro — user-facing API for defining custom named styles.
  • style_to_tags() — converts a Style into a Vec<TagType> for lexer expansion.
  • Custom tag resolution in parse_part() — unknown tags now check the registry before returning InvalidTag.
  • parse_part() return type changed from Result<TagType, LexError> to Result<Vec<TagType>, LexError> to support style expansion.
  • colorb!() bleeds at compile-time with the colorb() runtime counterpart.
Changed
  • parse_tag() updated to flatten nested Vec<TagType> results from parse_part().
  • All functions using compile can now benefit from compile-time processing instead of just validation.
Fixed
  • color!() now auto-resets.
0.2.2farben-macros
2026-03-15
Added
  • Dependency update to farben-core.
  • colorb!() macro that bleeds.
Fixed
  • color!() now auto-resets.
0.3.0farben-core
2026-03-15
Added
  • Style::parse() — builds a Style from a farben markup string.
  • Style::reset field — when true, overrides all other style attributes with a full SGR reset.
  • registry module — global style registry backed by OnceLock<Mutex<HashMap<String, Style>>>.
  • insert_style() — inserts a named style into the global registry.
  • search_registry() — looks up a named style from the global registry.
  • style!() macro — user-facing API for defining custom named styles.
  • style_to_tags() — converts a Style into a Vec<TagType> for lexer expansion.
  • Custom tag resolution in parse_part() — unknown tags now check the registry before returning InvalidTag.
  • parse_part() return type changed from Result<TagType, LexError> to Result<Vec<TagType>, LexError> to support style expansion.
Changed
  • parse_tag() updated to flatten nested Vec<TagType> results from parse_part().
0.3.3farben
2026-03-14
Added
  • cprintb! and cprintbln! for color-bleeding printing.
0.2.1farben-macros
2026-03-14
Added
  • 100% documentation coverage.
0.2.1farben-core
2026-03-14
Added
  • 100% documentation coverage.
0.3.2farben
2026-03-14
Added
  • cprint!() — prints farben-colored markup to stdout without a newline, behaves like print!.
  • cprintln!() — prints farben-colored markup to stdout with a trailing newline, behaves like println!.
  • Both macros support format args and compile-time validation when the compile feature is enabled.
0.3.0farben
2026-03-14
Added
  • color!() — compile-time markup processing via optional compile feature flag.
  • color_fmt!() — format args support with compile-time tag validation when compile is enabled.
  • validate_color!() — proc-macro that validates farben markup at compile time.
  • color_runtime() — internal runtime fallback used by color_fmt!.
  • bg: and fg: prefix support in color tags — [bg:red], [fg:white bg:blue].
  • farben-core and farben-macros as separate workspace crates.
  • compile feature flag for opt-in compile-time processing.
Changed
  • Internal logic moved to farben-core.
  • color() replaced by color! proc-macro when compile feature is enabled.
0.2.0farben-core
2026-03-14
Added
  • bg: and fg: prefix support for color tags.
  • Ground field added to TagType::Color variant.
  • Background color support in encode_color_sgr and color_to_ansi.
  • New tests for background color parsing, tokenizing, and rendering.
Changed
  • TagType::Color(Color) restructured to TagType::Color { color: Color, ground: Ground }.
0.2.0farben-core (cascade)
2026-03-14
Added
  • color!() — compile-time markup processing via optional compile feature flag.
  • color_fmt!() — format args support with compile-time tag validation.
  • validate_color!() — proc-macro that validates farben markup at compile time, emitting the original string literal unchanged on success.
  • color_runtime() — internal runtime fallback used by color_fmt!.
  • farben-core — extracted shared logic crate containing lexer, parser, ANSI encoding, and error types.
  • farben-macros — proc-macro crate powering compile-time processing.
  • Cargo workspace setup with farben, farben-core, and farben-macros as members.
  • compile feature flag — opt-in compile-time processing via farben-macros.
Changed
  • color() is now replaced by the color! proc-macro when the compile feature is enabled.
  • Internal logic extracted from farben into farben-core for shared use across crates.
0.1.0farben-core (cascade)
2026-03-14
Added
  • color() — colorizes a string using markup-like syntax, panics on invalid markup.
  • try_color() — same as color() but returns Result<String, LexError>.
  • Named color tags: [black], [red], [green], [yellow], [blue], [magenta], [cyan], [white].
  • 256-color palette support via [ansi(n)].
  • 24-bit RGB support via [rgb(r,g,b)].
  • Emphasis tags: [bold], [dim], [italic], [underline], [blink], [strikethrough].
  • Multi-tag brackets: [bold red], [italic rgb(255,0,0)].
  • Reset tag [/] to clear all active styles.
  • Escape sequence \[ to treat [ as a literal character.
  • LexError with variants UnclosedTag, InvalidTag, InvalidValue, InvalidArgumentCount.
  • Foreground and background color support via Ground enum.
  • Automatic reset appended to all color() and try_color() output.