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

x/crayon/src/conversions.ts>rgbToAnsi8

🖍️ Terminal styling done light and fast.
Go to Latest
function rgbToAnsi8
import { rgbToAnsi8 } from "https://deno.land/x/crayon@3.3.2/src/conversions.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