Commit 04fb145b6a3 for nodejs
commit 04fb145b6a3d0dc3cf06fcbcd1d3c0414fdc193c
Author: Chris Swithinbank <swithinbank@gmail.com>
Date: Tue Oct 13 22:17:24 2026 +0200
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>
diff --git a/doc/api/util.md b/doc/api/util.md
index 952f01d8aec..8714644a6fb 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -2822,9 +2822,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`.
@@ -2899,6 +2898,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
@@ -2909,6 +2911,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][].