Skip to content

mxthevs/colors

Repository files navigation


colors

Extract colors from any text file!



OCaml build workflow

Table of Contents

Introduction

What is this?

colors is a CLI that parse colors from text files. It can also convert colors between different formats. Currently the application supports parsing hexadecimals (without alpha) and converting them to RGB.

asciicast

⚠️ As of version 0.0.2, the output is in Truecolor mode, so if the colors does not look right, it is very likely that your terminal does not support Truecolor. In the upcoming versions, we plan to let the user customize the output format. You can check a list of devices that support Truecolor here.

Installation

Using npm

npm i @mxthevs/colors -g

Using yarn

yarn global add @mxthevs/colors

Usage

colors /path/to/file.{txt,json,etc}

In case you already have a package or shell function named colors in your system (This might be the case if you are using zsh, for example. You can check this by running type colors in your terminal), you can still run this package with the command:

npx @mxthevs/colors /path/to/file.{txt,json,etc}

Options

You can check the help page for the full set of options that colors accept.

colors --help

Feel free to report any bug that you encounter! 😃