Giter VIP home page Giter VIP logo

chalk.c's Introduction

chalk.c

🌈 Colorful Console C MACRO library

chalk.git

Features

Easy Install

  • ALL YOU NEED TO DO IS COPY AND PASTE chalk.h FILE.

Fast Performance

  • No runtime Execution, it will be preprocessed

Flexible Expressions

  • String Literal in C lets you write flexible expressions with CHALK

Examples

#include "chalk.h"

printf(CHALK_RED("Hello World"));
       ^ ~ colors "Hello World" to RED

printf(CHALK_BG_BLUE("Hello"));
       ^ ~ colors string "Hello" background color to blue

printf(CHALK_BG_BLUE(CHALK_RED("mixed usage")));
                     ^ ~~ character color red
        ^ ~~ background color blue

printf(CHALK_BLINK("blink"));
       ^ ~~ wrap string blink effect
#define CHALK_NO_PREFIX
        ^ ~~ this will allow you omit CHALK_ prefix
        ^ ~~ for example, RED instead of CHALK_RED
#include "chalk.h"

printf(BG_BLACK(MAGENTA("BLACK")) " " BG_MAGENTA(BLACK("PINK")));

printf(BOLD("ꡡ은 글씨") " " DIM("μ—°ν•œ 글씨") "\n");

printf(ITALIC("ITALIC " BOLD("ITALIC AND BOLD")));
/* template λ§Œλ“€κΈ° */
const char *int_template = MAGENTA("%d") "\n";
printf(int_template, 15);
  ~~> prints magenta colored "15"

const char *n_times_m = BLUE("%d X %d") " = " BG_CYAN("%d");
printf(n_times_m, 5, 6, 30);
  ~~> 5 X 6 blue
        ~~> = 
          ~~> 30 CYAN Background

MACRO Functions

color

MACRO Function
CHALK_BLACK
CHALK_RED
CHALK_GREEN
CHALK_YELLOW
CHALK_BLUE
CHALK_MAGENTA
CHALK_CYAN
CHALK_WHITE
MACRO Function
CHALK_LIGHT_BLACK
CHALK_LIGHT_RED
CHALK_LIGHT_GREEN
CHALK_LIGHT_YELLOW
CHALK_LIGHT_BLUE
CHALK_LIGHT_MAGENTA
CHALK_LIGHT_CYAN
CHALK_LIGHT_WHITE

Background color

MACRO Function
CHALK_BG_BLACK
CHALK_BG_RED
CHALK_BG_GREEN
CHALK_BG_YELLOW
CHALK_BG_BLUE
CHALK_BG_MAGENTA
CHALK_BG_CYAN
CHALK_BG_WHITE
MACRO Function
CHALK_BG_LIGHT_BLACK
CHALK_BG_LIGHT_RED
CHALK_BG_LIGHT_GREEN
CHALK_BG_LIGHT_YELLOW
CHALK_BG_LIGHT_BLUE
CHALK_BG_LIGHT_MAGENTA
CHALK_BG_LIGHT_CYAN
CHALK_BG_LIGHT_WHITE

miscellaneous

MACRO Function
CHALK_BOLD
CHALK_DIM
CHALK_ITALIC
CHALK_UNDERLINE
CHALK_BLINK
CHALK_STRIKE
CHALK_INVERSE
CHALK_HIDE

References

Named it after javascript chalk

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.