-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.c
62 lines (46 loc) · 1.31 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <stdio.h>
#include "visual.h"
int main() {
// Clear the screen
CLEAR();
// Hide the cursor
CURSOR_HIDE();
// Regular text
printf("Regular text.\n");
// Bold text and reset
printf(BOLD "Bold text.\n" RESET);
printf(DIM "Dimmed text.\n" RESET);
printf(ITALIC "Italic text.\n" RESET);
printf(UNDER "Underlined text.\n" RESET);
printf(BLINK "Blinking text.\n" RESET);
printf(INVERSE "Inversed text.\n" RESET);
printf(STRIKE "Stroked text.\n" RESET);
// Dim, blinking and crossed text
printf(DIM STRIKE "Messy text.\n" RESET);
// Text, colored with 256 colors
FG_256(51);
BG_256(92);
printf("256 text.\n");
// Disable background
BG_DISABLE();
printf("Disabled background.\n");
// Text, colored with RGB colors
FG_RGB(71, 221, 2);
BG_RGB(221, 2, 71);
printf("Rgb text.\n");
// Disable foreground
FG_DISABLE();
printf("Disabled foreground.\n");
// Reset via function
RESETF();
printf("Enter a char and hit enter...");
// Hide the output
OUTPUT_HIDE();
// Get some user input to check the hidden input and the output
int ch = getchar();
// Display the input normally
printf(RESET "\n%c\n", ch);
// Show the cursor and end this test
CURSOR_SHOW();
return 0;
}