GithubHelp home page GithubHelp logo

code_terminal_colors's Introduction

Code_Terminal_Colors

Colorful Terminal Prints

Format

ESC Color Code String or Character
  • ESC Escape Character "\033"
  • Color Code Equivalent code
  • String or Character

Color Terminal in C

IMG

This is Tested using Windows Operating System For this to Work you must clear the terminal first using "cls" command, to do that use the function system(), which requires you to include stdlib.h

  #include <stdio.h>
  #include <stdlib.h>
  #define RESET    "\033[0m"
  //Font Colors
  #define BLK "\033[30m"
  #define RED "\033[31m"
  #define GRN "\033[32m"
  #define YEL "\033[33m"
  #define BLU "\033[34m"
  #define MAG "\033[35m"
  #define CYN "\033[36m"
  #define WHT "\033[37m"
  #define GRY "\033[90m"
  //Font Colors Light

  #define LRED "\033[91m"
  #define LGRN "\033[92m"
  #define LYEL "\033[93m"
  #define LBLU "\033[94m"
  #define LMAG "\033[95m"
  #define LCYN "\033[96m"
  #define LWHT "\033[97m"

  //Background Colors
  #define BKG_BLK "\033[40m"
  #define BKG_RED "\033[41m"
  #define BKG_GRN "\033[42m"
  #define BKG_YEL "\033[43m"
  #define BKG_BLU "\033[44m"
  #define BKG_MAG "\033[45m"
  #define BKG_CYN "\033[46m"
  #define BKG_WHT "\033[47m"

  int main(){
      system("cls");
      printf(RED " RED " GRN" GREEN " BLU" BLUE " YEL" YELLOW " CYN" CYAN " MAG " MAGENTA \n" RESET );
      printf(BKG_RED " RED " BKG_GRN" GREEN " BKG_BLU" BLUE " BKG_YEL" YELLOW "  BKG_CYN" CYAN " BKG_MAG " MAGENTA \n" RESET );
      return 0;
  }

code_terminal_colors's People

Contributors

bonezegei avatar

Watchers

 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.