Coder Social home page Coder Social logo

ansi's Introduction

ansi

ANSI escape code library for Erlang.

Features

  • Smart ๐Ÿง 

    Terminal color support is detected automatically on load, based on various factors such as environment variables and tput output (if available).

  • Respectful ๐Ÿ™

    Respects NO_COLOR for disabling colorized output if set by the user. This can be overridden with ansi:set_mode(Mode).

  • Fast โšก๏ธ

    The terminal color mode is detected and stored as a persistent term once on module load. When used, the library only produces deep IO lists with no unnecessary flattening.

  • Composable ๐Ÿ”ง

    ansi does not assume printing to the console. The user can send the resulting IO data wherever they want (console, file, log etc.) using the appropriate library functions in OTP (or elsewhere).

Color Tool

colortool screenshot

ansi includes a color helper CLI tool that can be used to enumerate colors.

Usage

$ _build/tool/bin/colortool --help
usage: colortool [-b BACKGROUNDS] [-f FOREGROUNDS] [-t TEXT]

Optional arguments:
  -b, --backgrounds The set of background colors to enumerate ('0..16')
  -f, --foregrounds The set of foreground colors to enumerate ('0..16')
  -t, --text        The example text to display

The color ranges should be a comma separated list of either individual color codes or a range in the format FROM..TO. Each color code must be between 0 and 255. Example:

0..8,16,232..255

Build

$ rebar3 as tool escriptize

This produces a binary at _build/tool/bin/colortool.

ansi's People

Contributors

eproxus avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kianmeng

ansi's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.