JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q27018F
  • License MIT

Convert hex colors to closest xterm

Package Exports

  • hexterm

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexterm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hexterm

Get the xterm closest color to a hexadecimal color

Build Status npm version

Usage

Programatically

Install locally

npm install hexterm

Require hexterm and pass a string to it

import hexterm from 'hexterm'

hexterm('005fd7') // 26
hexterm('#005fd7') // 26
hexterm('005ED9') // 26
hexterm('ff0') // 11
hexterm('#ff0') // 11

CLI

npx

npx hexterm 005fd7

Install globally

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'

Test

Install dev-dependencies and run tests

npm install && npm tst

© 2016-2020 Jacobo Tabernero - Released under MIT License