MCPcopy Create free account
hub / github.com/aboSamoor/pycld2 / GetBackColor

Function GetBackColor

cld2/internal/debug.cc:171–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169static const int kEnglishBackground = 0xfffff4; // very light yellow
170
171static int GetBackColor(Language lang, bool lighten) {
172 int retval;
173 if (lang == ENGLISH) {
174 retval = kEnglishBackground;
175 } else if (lang == UNKNOWN_LANGUAGE) {
176 retval = kUnscoredBackground;
177 } else if (lang == TG_UNKNOWN_LANGUAGE) {
178 retval = kIgnoremeBackground;
179 } else if (lang < 0) {
180 retval = kUnscoredBackground;
181 } else {
182 retval = kLangBackground[lang & 0x0f];
183 }
184 if (lighten) {
185 // Make 1/2 as far away from white
186 retval = (retval >> 1) | 0x808080;
187 }
188 return retval;
189}
190
191static int GetTextColor(Language lang, bool lighten) {
192 int retval;

Callers 3

GetColorHtmlEscapedTextFunction · 0.85
CLD2_DebugFunction · 0.85
CLD2_Debug2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected