File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 11
11
//! Color::rgb(0x1111, 0xaaaa, 0xffff)
12
12
//! );
13
13
//! ```
14
+
14
15
use core:: fmt;
15
16
use std:: error;
16
17
use std:: marker:: PhantomData ;
@@ -47,12 +48,15 @@ impl Color {
47
48
/// Parses the subset of X11 [Color Strings](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Color_Strings)
48
49
/// emitted by terminals in response to `OSC` color queries (`OSC 10`, `OSC 11`, ...).
49
50
///
51
+ /// This function is a rough analogue to `XParseColor`.
52
+ ///
50
53
/// ## Accepted Formats
51
54
/// * `#<red><green><blue>`
52
55
/// * `rgb:<red>/<green>/<blue>`
53
56
/// * `rgba:<red>/<green>/<blue>/<alpha>` (rxvt-unicode extension)
54
57
///
55
58
/// where `<red>`, `<green>` and `<blue>` are hexadecimal numbers with 1-4 digits.
59
+ #[ doc( alias = "XParseColor" ) ]
56
60
pub fn parse ( input : & [ u8 ] ) -> Result < Color , ColorParseError > {
57
61
xparsecolor ( input) . ok_or ( ColorParseError ( PhantomData ) )
58
62
}
You can’t perform that action at this time.
0 commit comments