MCPcopy Create free account
hub / github.com/DentonW/DevIL / XpmPredefCol

Function XpmPredefCol

DevIL/src-IL/src/il_xpm.cpp:336–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334
335
336ILboolean XpmPredefCol(char *Buff, XpmPixel *Colour)
337{
338 ILint len;
339 ILint val = 128;
340
341 if (!stricmp(Buff, "none")) {
342 (*Colour)[0] = 0;
343 (*Colour)[1] = 0;
344 (*Colour)[2] = 0;
345 (*Colour)[3] = 0;
346 return IL_TRUE;
347 }
348
349 (*Colour)[3] = 255;
350
351 if (!stricmp(Buff, "black")) {
352 (*Colour)[0] = 0;
353 (*Colour)[1] = 0;
354 (*Colour)[2] = 0;
355 return IL_TRUE;
356 }
357 if (!stricmp(Buff, "white")) {
358 (*Colour)[0] = 255;
359 (*Colour)[1] = 255;
360 (*Colour)[2] = 255;
361 return IL_TRUE;
362 }
363 if (!stricmp(Buff, "red")) {
364 (*Colour)[0] = 255;
365 (*Colour)[1] = 0;
366 (*Colour)[2] = 0;
367 return IL_TRUE;
368 }
369 if (!stricmp(Buff, "green")) {
370 (*Colour)[0] = 0;
371 (*Colour)[1] = 255;
372 (*Colour)[2] = 0;
373 return IL_TRUE;
374 }
375 if (!stricmp(Buff, "blue")) {
376 (*Colour)[0] = 0;
377 (*Colour)[1] = 0;
378 (*Colour)[2] = 255;
379 return IL_TRUE;
380 }
381 if (!stricmp(Buff, "yellow")) {
382 (*Colour)[0] = 255;
383 (*Colour)[1] = 255;
384 (*Colour)[2] = 0;
385 return IL_TRUE;
386 }
387 if (!stricmp(Buff, "cyan")) {
388 (*Colour)[0] = 0;
389 (*Colour)[1] = 255;
390 (*Colour)[2] = 255;
391 return IL_TRUE;
392 }
393 if (!stricmp(Buff, "gray")) {

Callers 1

XpmGetColourFunction · 0.85

Calls 2

stricmpFunction · 0.85
ilCharStrLenFunction · 0.85

Tested by

no test coverage detected