@jacoborus/hexterm@2.1.1
latest
jacoborus/hextermWorks with
•JSR Score94%•This package works with Deno, Browsers

Downloads72/wk
•Published2 years ago (2.1.1)
Get the xterm closest color to a hexadecimal color
hexterm
Get the xterm closest color to a hexadecimal color.
It works in Node.js, Deno and browsers
Usage
Programatically
// deno import { hexterm } from "jsr:@jacoborus/hexterm"; // node.js import { hexterm } from "hexterm"; hexterm("005fd7"); // 26 hexterm("#005fd7"); // 26 hexterm("005ED9"); // 26 hexterm("ff0"); // 11 hexterm("#ff0"); // 11
CLI
Install globally
# deno deno install -n hexterm jsr:@jacoborus/hexterm/cli # node npm install -g hexterm
Call from your shell: hexterm <color>
hexterm 005fd7
Remember to wrap the color code between quotes if has numeral prefix (#)
hexterm '#ff0'
Alternatively, you can call hexterm using npx
npx hexterm 005fd7
Test
deno test
Development
To build npm compatible module:
deno task build-npm
© 2016-2024 Jacobo Tabernero Rey - Released under MIT License
Add Package
deno add jsr:@jacoborus/hexterm
Import symbol
import * as hexterm from "@jacoborus/hexterm";
Import directly with a jsr specifier
import * as hexterm from "jsr:@jacoborus/hexterm";