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

x/crayon/src/conversions.ts>rgbToAnsi4

🖍️ Terminal styling done light and fast.
Go to Latest
function rgbToAnsi4
import { rgbToAnsi4 } from "https://deno.land/x/crayon@3.3.2/src/conversions.ts";

Converts RGB color representation to 4Bit (16) ANSI

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

Parameters

r: number
g: number
b: number

Returns

number