MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / SzColorHTML

Function SzColorHTML

general.cpp:2268–2288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2266// Return the string to use for a RGB color value in an HTML or SVG file.
2267
2268CONST char *SzColorHTML(KI ki)
2269{
2270 static char szCol[8];
2271 KV kv;
2272
2273 // Check if the color matches one of the SVG predefined color names.
2274 if (ki >= 0) {
2275 if (
2276#ifdef GRAPH
2277 rgbbmp[ki] == rgbbmpDef[ki] &&
2278#endif
2279 *szColorHTML[ki] != chNull)
2280 return szColorHTML[ki];
2281 kv = rgbbmp[ki];
2282 } else
2283 kv = -ki;
2284
2285 // Otherwise compose the RGB value for this color.
2286 sprintf(szCol, "#%06x", Rgb(RgbB(kv), RgbG(kv), RgbR(kv)));
2287 return szCol;
2288}
2289
2290
2291#ifdef TIME

Callers 5

DrawSpotFunction · 0.85
DrawBlockFunction · 0.85
AnsiColorFunction · 0.85
SvgSetColorFunction · 0.85
SvgTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected