-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
55 lines (46 loc) · 1.26 KB
/
test.js
File metadata and controls
55 lines (46 loc) · 1.26 KB
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
var cc = require("./index");
// red
cc.red("Successful red string");
// yellow
cc.yellow("Successful yellow string");
// green
cc.green("Successful green string");
// blue
cc.blue("Successful blue string");
// cyan
cc.cyan("Successful cyan string");
// magenta
cc.magenta("Successful magenta string");
// gray
cc.gray("Successful gray string");
// Backgrounds \\
// background black
cc.bg("Successful black background", "black");
// background red
cc.bg("Successful red background", "red");
// background green
cc.bg("Successful green background", "green");
// background yellow
cc.bg("Successful yellow background", "yellow");
// background blue
cc.bg("Successful blue background", "blue");
// background magenta
cc.bg("Successful magenta background", "magenta");
// background cyan
cc.bg("Successful cyan background", "cyan");
// background white
cc.bg("Successful white background", "white");
// xTerm \\
for (var i = 0; i < 256; i++) {
string = "Successful xTerm colour " + i;
cc.xText(string, i);
}
for (var i = 0; i < 256; i++) {
string = "Successful xTerm colour " + i;
cc.xBg(string, i);
}
//error
cc.green("\nerror handling\n");
cc.bg("Successful error handling", "not_a_colour")
cc.xText("Invalid xTerm number", 999);
cc.xText("Invalid xTerm number type", "string")