mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: clarify hex code usage in styleText docs
Signed-off-by: Chris Swithinbank <swithinbank@gmail.com> PR-URL: https://github.com/nodejs/node/pull/66539 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
1 parent
9fc002efd4
commit
9ef0b7ad92
1 file changed
+8
-3
+8
-3
@@ -2818,9 +2818,8 @@ changes:
|
||||
such as NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.
|
||||
-->
|
||||
|
||||
* `format` {string | Array} A text format or an Array
|
||||
of text formats defined in `util.inspect.colors`, or a hex color in `#RGB`
|
||||
or `#RRGGBB` form.
|
||||
* `format` {string | Array} A text format defined in `util.inspect.colors`,
|
||||
a hex color in `#RGB` or `#RRGGBB` form, or an Array of text formats and/or hex colors.
|
||||
* `text` {string} The text to be formatted.
|
||||
* `options` {Object}
|
||||
* `validateStream` {boolean} When true, `stream` is checked to see if it can handle colors. **Default:** `true`.
|
||||
@@ -2895,6 +2894,9 @@ console.log(styleText('#ff5733', 'Orange text'));
|
||||
|
||||
// 3-digit hex color (shorthand)
|
||||
console.log(styleText('#f00', 'Red text'));
|
||||
|
||||
// Hex color combined with other modifiers
|
||||
console.log(styleText(['#00f', 'bold'], 'Bold blue text'));
|
||||
```
|
||||
|
||||
```cjs
|
||||
@@ -2905,6 +2907,9 @@ console.log(styleText('#ff5733', 'Orange text'));
|
||||
|
||||
// 3-digit hex color (shorthand)
|
||||
console.log(styleText('#f00', 'Red text'));
|
||||
|
||||
// Hex color combined with other modifiers
|
||||
console.log(styleText(['#00f', 'bold'], 'Bold blue text'));
|
||||
```
|
||||
|
||||
The full list of formats can be found in [modifiers][].
|
||||
|
||||
Reference in new issue
Block a user