Giter Site home page Giter Site logo

luma's Introduction

Luma

Luma is just a bunch of macros written to make it easier to use/remember ANSI Escape Sequences.

Usage

It's pretty easy, just use them like you would use a "string". For example:

puts( EF_RED " This is red text " EF_END );
Will output "This is red text" to stdout in red color if ANSI escape sequences are supported on your terminal.

Note: One should always output ESC_END before terminating the program to make sure that the terminal is back to attributes.

List of escape sequences

These are complete escape sequences to use for formatting output.

There are 3 categories of supported escape sequences:

  • Text Attributes ET
    for styling the text.

  • Foreground Colors EF
    for changing font color.

  • Background Colors EB
    for changing highlight color.

From Wikipedia/ANSI_escape_code

ET_BRIGHT/ET_BRIGHT_OFF Turn on/off Bright (increased intensity) or Bold

ET_FAINT/ET_FAINT_OFF Turn on/off Faint (decrease intensity)

ET_ITALIC/ET_ITALIC_OFF Turn on/off Italic

ET_UNDERLINE/ET_UNDERLINE_OFF Turn on/off Underline

ET_BLINK/ET_BLINK_OFF Turn on/off Blink

ET_REVERSE/ET_REVERSE_OFF Turn on/off Reverse (swap foreground and background)

ET_CROSSED/ET_CROSSED_OFF Turn on Strikethrough

EF_COLOR Turn on foreground color where
COLOR = { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, DEFAULT }

EB_COLOR Turn on background color where
COLOR = { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, DEFAULT }

Compatibility

Run esc_support after make to check your terminal's support for ANSI escape sequences.

luma's People

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.