Skip to main content

@std/fmt@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score58%
Published2 years ago (0.215.0)
function rgb24
rgb24(
str: string,
color: number | Rgb
): string

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

To produce the color magenta:

import { rgb24 } from "@std/fmt/colors";

rgb24("foo", 0xff00ff);
rgb24("foo", {r: 255, g: 0, b: 255});

Parameters

text color to apply 24bit rgb to

code

Return Type

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/fmt

Import symbol

import { rgb24 } from "@std/fmt/colors";
or

Import directly with a jsr specifier

import { rgb24 } from "jsr:@std/fmt/colors";