Code Monkey home page Code Monkey logo

visual's Introduction

visual.h

Tiny single header C lib for simple ANSI escape codes usage. It's really simple, but can save you a little time and make your code look a bit nicer.

There are no guaranties, that this lib will fully work in work in your terminal, please, test it out before using.

Also, please include stdio.h to make it work!


Usage

To apply an attribute, just format it into your message, for example: printf(BOLD "Display bold text and reset.\n" RESET);, or call a function.

Keep in mind, that when an attribute is set, it will be applied to everything, until reseted or disabled!

Use RESET and RESETF() to reset everything.

CLEAR() returns the terminal to the initial state.

  • Text attributes

    • BOLD
    • DIM
    • ITALIC
    • UNDER
    • BLINK
    • INVERSE
    • INVIS
    • STRIKE
  • 256 colors

    • FG_256(code)
    • BG_256(code)
  • RGB colors

    • FG_RGB(r, g, b)
    • BG_RGB(r, g, b)
  • Disable colors

    • FG_DISABLE()
    • BG_DISABLE()
  • Resets

    • RESET
    • RESETF()
  • Utilities

    • CLEAR()
    • OUTPUT_HIDE()
  • Cursor

    • CURSOR_HIDE()
    • CURSOR_SHOW()

To Do

  • Different clearing functions
  • Custom attribute disabling
  • Make function alternatives to vars and vice versa

Note: This lib was made in one day for my personal use, but i would love to make it good and safe in the near future. Please, give me your feedback and ideas if you want to!

visual's People

Contributors

t3mp14r3 avatar darksamus669 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.