"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.js');
let src_external_yoctocolors_cjs = require("../external/yoctocolors-cjs");
src_external_yoctocolors_cjs = require_runtime.__toESM(src_external_yoctocolors_cjs);

//#region src/logger/colors.ts
/**
* @file Color application helpers for `logger/*` modules. Wraps the vendored
*   `yoctocolors-cjs` palette so the logger can accept either a named color
*   (`'green'`) or an explicit RGB tuple (`[255, 0, 0]`); RGB tuples are
*   emitted via the 24-bit `[38;2;...m` escape because `yoctocolors-cjs`
*   doesn't ship an `rgb()` helper.
*/
/**
* Apply a color to text using yoctocolors. Handles both named colors and RGB
* tuples.
*/
/*@__NO_SIDE_EFFECTS__*/
function applyColor(text, color, colors) {
	if (typeof color === "string") return colors[color](text);
	const { 0: r, 1: g, 2: b } = color;
	return `\u001B[38;2;${r};${g};${b}m${text}\u001B[39m`;
}
/**
* Get the yoctocolors module for terminal colors.
*/
/*@__NO_SIDE_EFFECTS__*/
function getYoctocolors() {
	return src_external_yoctocolors_cjs.default;
}

//#endregion
exports.applyColor = applyColor;
exports.getYoctocolors = getYoctocolors;