Giter VIP home page Giter VIP logo

erlang-color's Introduction

Color

Build Status

ANSI colors for your Erlang

Usage:

ANSI standard colors

1> io:format("Hello, this is the ~s color~n", [ color:red("red") ]).

screen shot 2014-02-11 at 9 17 58 am

1> io:format("Hello, this is on ~s~n", [ color:on_blue("blue blackground") ]).

screen shot 2014-02-11 at 9 16 25 am

Make sure you use the ~s string type, ~p will escape the ANSI code.

Screenshot

xterm 256 colors

1> io:format("Hello, this color is ~s~n", [ color:rgb([0,1,0], "green") ]).

screen shot 2014-02-11 at 9 23 49 am

true 24-bit colors

Note: as of this writing, 24-bit colors (ISO-8613-3) are not widely adopted in terminal emulators. Konsole and iTerm2 nighly builds are known to support them.

1> io:format("The solarized template is ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~s ~n", [
  color:true("002B36", "base03"), color:true("073642", "base02"), color:true("586E75", "base01"),
  color:true("657B83", "base00"), color:true("839496", "base0"),  color:true("93A1A1", "base1"),
  color:true("EEE8D5", "base2"),  color:true("FDF6E3", "base3"),  color:true("B58900", "yellow"),
  color:true("CB4B16", "orange"), color:true("DC322F", "red"),    color:true("D33682", "magenta"),
  color:true("6C71C4", "violet"), color:true("268BD2", "blue"),   color:true("2AA198", "cyan"),
  color:true("859900", "green")]).

screen shot 2014-02-13 at 9 53 49 am

The MIT License (MIT)

Copyright (c) 2014 Julian Duque, Evgeni Kolev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation nfiles (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

erlang-color's People

Contributors

julianduque avatar edkolev avatar eproxus avatar essen avatar

Watchers

James Cloos avatar  avatar

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.