Changelog
0.7.1farben
Added
style!()— moved fromfarben-core. Defines a named style in the global registry. Gated behind theformatfeature.prefix!()— moved fromfarben-core. Sets a prefix string on a previously defined named style. Gated behind theformatfeature.
0.6.1farben-core
Changed
style!()— moved tofarben. Users importing directly fromfarben-coreshould update tofarben::style!().prefix!()— moved tofarben. Users importing directly fromfarben-coreshould update tofarben::prefix!().
0.3.1farben-macros
Changed
- Minor dependency update to
farben-core.
0.3.0farben-macros
Changed
colorb!— replaced one-line stub doc with a full doc comment explaining what bleed means, when to use it, and how it differs fromcolor!. Includes a working example.validate_color!— removed misleading user-facing example. Doc comment now explicitly marks it as internal and directs users towardcolor!andcolor_fmt!.
0.7.0farben
Added
colorb— added missing doc comment explaining bleed behavior and when to use it overcolor.color_fmt!(compile-time variant) — added missing doc comment. Previously the runtime variant was documented but thecompile-feature counterpart had none.
Changed
- Crate-level doc comment revised: fixed grammar and capitalized "German".
Fixed
cprint!(compile-time variant) — example referenced unbound variablemessage. Added declaration so it compiles as a doctest.cprintln!(compile-time variant) — example referenced unbound variableresult. 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
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 byregistry::set_prefixwhen the given style name has not been registered.registry::set_prefixnow returnsResult<(), LexError>instead of(), allowing callers to handle unknown style names without panicking.
Changed
ansi::style_to_ansipromoted frompub(crate)topub. Users building on top offarben-corecan 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 theResultreturned byset_prefix, preserving panic-on-misuse at the macro callsite.LexError::InvalidArgumentCountdisplay improved from"expected N, got M"to"expected N arguments, got M".
Fixed
lexer::parse_part— replacedpanic!withErr(LexError::InvalidResetTarget)when a reset tag targets aResetorPrefixnode.registry::set_prefix— replacedpanic!withErr(LexError::UnknownStyle)when the style name is not found in the registry.errors.rs— corrected typo inUnclosedValuedisplay: "parantheses" → "parentheses".ansi::NamedColordoc 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 onStringreturn values.
0.6.0farben-core (cascade)
Added
- Specified resets —
[/bold],[/red],[/italic]etc. reset only the named style, leaving all other active styles intact. TagType::Resetnow takesOption<Box<TagType>>—Nonefor full reset[/],Some(tag)for partial reset.parser::rendernow maintains an active tag stack, re-emitting surviving styles after a partial reset.
Changed
TagType::Resetchanged from a unit variant toReset(Option<Box<TagType>>).- All existing
[/]full reset behavior is preserved viaReset(None).
Fixed
- Fixed a bug where
colorb!()did not exist when using thecompilefeature.
0.2.6farben / farben-macros
Changed
- Minor dependency update to
farben-core.
0.5.1farben
Changed
- Minor dependency update to
farben-core.
0.2.5farben-macros
Changed
- Minor dependency update to
farben-core.
0.4.2farben-core
Added
- Bright ANSI color variants (
bright-blackthroughbright-white).
0.5.0farben-core (cascade)
Added
- Added bugs.
Style::prefixfield — 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 emitsTagType::Prefixas the first tag when a prefix is present.parser::render()now handlesTagType::Prefixby appending the text directly to output.formatdefault feature — gates logic forstyle!()andprefix!().
Changed
style_to_tags()no longer returns early onresetwhen a prefix is present; prefix is always emitted first.style!()is now gated to theformatfeature.
0.4.1farben-core
Fixed
- Bug where
prefix!()interfered with actual color styling.
0.2.4farben-macros
Changed
- Minor dependency update to
farben-core.
0.2.3farben-macros
Changed
- Minor dependency update to
farben-core.
0.4.0farben-core (cascade)
Added
Style::parse()— builds aStylefrom a farben markup string.Style::resetfield — whentrue, overrides all other style attributes with a full SGR reset.registrymodule — global style registry backed byOnceLock<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 aStyleinto aVec<TagType>for lexer expansion.- Custom tag resolution in
parse_part()— unknown tags now check the registry before returningInvalidTag. parse_part()return type changed fromResult<TagType, LexError>toResult<Vec<TagType>, LexError>to support style expansion.colorb!()bleeds at compile-time with thecolorb()runtime counterpart.
Changed
parse_tag()updated to flatten nestedVec<TagType>results fromparse_part().- All functions using
compilecan now benefit from compile-time processing instead of just validation.
Fixed
color!()now auto-resets.
0.2.2farben-macros
Added
- Dependency update to
farben-core. colorb!()macro that bleeds.
Fixed
color!()now auto-resets.
0.3.0farben-core
Added
Style::parse()— builds aStylefrom a farben markup string.Style::resetfield — whentrue, overrides all other style attributes with a full SGR reset.registrymodule — global style registry backed byOnceLock<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 aStyleinto aVec<TagType>for lexer expansion.- Custom tag resolution in
parse_part()— unknown tags now check the registry before returningInvalidTag. parse_part()return type changed fromResult<TagType, LexError>toResult<Vec<TagType>, LexError>to support style expansion.
Changed
parse_tag()updated to flatten nestedVec<TagType>results fromparse_part().
0.3.3farben
Added
cprintb!andcprintbln!for color-bleeding printing.
0.2.1farben-macros
Added
- 100% documentation coverage.
0.2.1farben-core
Added
- 100% documentation coverage.
0.3.2farben
Added
cprint!()— prints farben-colored markup to stdout without a newline, behaves likeprint!.cprintln!()— prints farben-colored markup to stdout with a trailing newline, behaves likeprintln!.- Both macros support format args and compile-time validation when the
compilefeature is enabled.
0.3.0farben
Added
color!()— compile-time markup processing via optionalcompilefeature flag.color_fmt!()— format args support with compile-time tag validation whencompileis enabled.validate_color!()— proc-macro that validates farben markup at compile time.color_runtime()— internal runtime fallback used bycolor_fmt!.bg:andfg:prefix support in color tags —[bg:red],[fg:white bg:blue].farben-coreandfarben-macrosas separate workspace crates.compilefeature flag for opt-in compile-time processing.
Changed
- Internal logic moved to
farben-core. color()replaced bycolor!proc-macro whencompilefeature is enabled.
0.2.0farben-core
Added
bg:andfg:prefix support for color tags.Groundfield added toTagType::Colorvariant.- Background color support in
encode_color_sgrandcolor_to_ansi. - New tests for background color parsing, tokenizing, and rendering.
Changed
TagType::Color(Color)restructured toTagType::Color { color: Color, ground: Ground }.
0.2.0farben-core (cascade)
Added
color!()— compile-time markup processing via optionalcompilefeature 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 bycolor_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, andfarben-macrosas members. compilefeature flag — opt-in compile-time processing viafarben-macros.
Changed
color()is now replaced by thecolor!proc-macro when thecompilefeature is enabled.- Internal logic extracted from
farbenintofarben-corefor shared use across crates.
0.1.0farben-core (cascade)
Added
color()— colorizes a string using markup-like syntax, panics on invalid markup.try_color()— same ascolor()but returnsResult<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. LexErrorwith variantsUnclosedTag,InvalidTag,InvalidValue,InvalidArgumentCount.- Foreground and background color support via
Groundenum. - Automatic reset appended to all
color()andtry_color()output.