Giter VIP home page Giter VIP logo

consoleprettify's Introduction

Console Prettify🎨 (alpha)

A simple tool for making good UI in C/C++ console apps with little effort.


How to Use 🖥️

Download or clone this repository. Copy prettify_functions.c and ConsolePrettify.h into your project folder and add #include "ConsolePrettify.h" in your C/C++ files.

Make sure the new files are correctly linked in your IDE/compiler.

Available Functions

Function Description
void prettify_textcolor(color) Changes the text color
void prettify_print(text, color) Prints text at the screen center
void prettify_textbox(specifier, variable, color) Displays an input field and reads user input
void prettify_textbox_password(variable, mask, color) Displays an input field with masking eg. *****
int prettify_menu(title, color, numOptions, ...) Displays a menu and returns the number of the selected option
void prettify_list_ordered(title, color, items) Displays an ordered list of items

NOTE: Please use prettify_textcolor() for all colored text in your program..


Available Colors 🌈

use any of these constants as the color arguments of prettify functions

Constant Name Value
RED 12
GREEN 10
LIGHT_BLUE 11
YELLOW 6
LIGHT_YELLOW 14
BLUE 9
PURPLE 5
WHITE 15
CYAN 3
GRAY 7
DARK_GRAY 8

Examples

Textboxes:

int num;
char password[25];

printf("THIS IS A TEXTBOX");
prettify_textbox("%i", &num, YELLOW);

printf("\nTHIS IS A PASSWORD TEXTBOX");
prettify_textbox_password(password, '+', BLUE);

Output

Menus

int choice = prettify_menu("Select an option", RED, 4,
                  "Buy bananas",
                  "Buy apple",
                  "Buy mango",
                  "Buy grapes");

Output

Lists

char **people = {"Justin", "Kim", "Susan"};
prettify_list_ordered("List of People", GREEN, people);

Output

TODO

  • Add automatic Table printing
  • Print to center

License


ConsolePrettify is MIT licensed.

consoleprettify's People

Contributors

shawn-grant 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.