xref: /haiku/src/apps/terminal/Colors.cpp (revision 7a74a5df454197933bc6e80a542102362ee98703)
1 /*
2  * Copyright 2010, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include "Colors.h"
7 
8 #include <Catalog.h>
9 
10 
11 #undef B_TRANSLATION_CONTEXT
12 #define B_TRANSLATION_CONTEXT "Terminal colors schema"
13 
14 
15 const rgb_color kBlack= { 0, 0, 0, 255 };
16 const rgb_color kWhite = { 255, 255, 255, 255 };
17 const rgb_color kGreen = { 0, 255, 0, 255 };
18 
19 const struct color_schema kBlackOnWhite = {
20 	B_TRANSLATE("Black on White"),
21 	kBlack,
22 	kWhite,
23 	kWhite,
24 	kBlack,
25 	kWhite,
26 	kBlack
27 };
28 
29 
30 const struct color_schema kWhiteOnBlack = {
31 	B_TRANSLATE("White on Black"),
32 	kWhite,
33 	kBlack,
34 	kBlack,
35 	kWhite,
36 	kBlack,
37 	kWhite
38 };
39 
40 const struct color_schema kGreenOnBlack = {
41 	B_TRANSLATE("Green on Black"),
42 	kGreen,
43 	kBlack,
44 	kBlack,
45 	kGreen,
46 	kBlack,
47 	kGreen
48 };
49 
50 struct color_schema gCustomSchema = {
51 	B_TRANSLATE("Custom")
52 };
53 
54 const color_schema* gPredefinedSchemas[] = {
55 		&kBlackOnWhite,
56 		&kWhiteOnBlack,
57 		&kGreenOnBlack,
58 		&gCustomSchema,
59 		NULL
60 };
61 
62 
63 bool
64 color_schema::operator==(const color_schema& schema)
65 {
66 	if (text_fore_color == schema.text_fore_color
67 		&& text_back_color == schema.text_back_color
68 		&& cursor_fore_color == schema.cursor_fore_color
69 		&& cursor_back_color == schema.cursor_back_color
70 		&& select_fore_color == schema.select_fore_color
71 		&& select_back_color == schema.select_back_color)
72 		return true;
73 
74 	return false;
75 }
76