Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/crayon/mod.ts>rgbToAnsi8

🖍️ Terminal styling done light and fast.
Latest
function rgbToAnsi8
Re-export
import { rgbToAnsi8 } from "https://deno.land/x/crayon@3.3.3/mod.ts";

Converts RGB color representation to 8Bit (256) ANSI

This is slightly modified rgb.ansi256 conversion from https://github.com/Qix-/color-convert/blob/master/conversions.js

Parameters

r: number
g: number
b: number

Returns

number