Skip to content

Commit 8e25d0d

Browse files
committed
📝 Mention XParseColor
1 parent 996dbec commit 8e25d0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/xterm-color/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//! Color::rgb(0x1111, 0xaaaa, 0xffff)
1212
//! );
1313
//! ```
14+
1415
use core::fmt;
1516
use std::error;
1617
use std::marker::PhantomData;
@@ -47,12 +48,15 @@ impl Color {
4748
/// Parses the subset of X11 [Color Strings](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Color_Strings)
4849
/// emitted by terminals in response to `OSC` color queries (`OSC 10`, `OSC 11`, ...).
4950
///
51+
/// This function is a rough analogue to `XParseColor`.
52+
///
5053
/// ## Accepted Formats
5154
/// * `#<red><green><blue>`
5255
/// * `rgb:<red>/<green>/<blue>`
5356
/// * `rgba:<red>/<green>/<blue>/<alpha>` (rxvt-unicode extension)
5457
///
5558
/// where `<red>`, `<green>` and `<blue>` are hexadecimal numbers with 1-4 digits.
59+
#[doc(alias = "XParseColor")]
5660
pub fn parse(input: &[u8]) -> Result<Color, ColorParseError> {
5761
xparsecolor(input).ok_or(ColorParseError(PhantomData))
5862
}

0 commit comments

Comments
 (0)