|
@@ -258,14 +258,24 @@ static const struct { |
|
|
{ "/PathSet/res/ShiftyMod.svg", {}, -1 }, |
|
|
{ "/PathSet/res/ShiftyMod.svg", {}, -1 }, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
static inline bool invertPaint(NSVGpaint& paint, const char* const svgFileToInvert = nullptr) |
|
|
|
|
|
|
|
|
static inline bool invertPaint(NSVGshape* const shape, NSVGpaint& paint, const char* const svgFileToInvert = nullptr) |
|
|
{ |
|
|
{ |
|
|
// Special case for DrumKit background grandient |
|
|
|
|
|
if (paint.type == NSVG_PAINT_LINEAR_GRADIENT && svgFileToInvert != nullptr && std::strncmp(svgFileToInvert, "/DrumKit/", 9) == 0) |
|
|
|
|
|
|
|
|
if (paint.type == NSVG_PAINT_LINEAR_GRADIENT && svgFileToInvert != nullptr) |
|
|
{ |
|
|
{ |
|
|
paint.type = NSVG_PAINT_COLOR; |
|
|
|
|
|
paint.color = 0xff191919; |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
// Special case for DrumKit background gradient |
|
|
|
|
|
if (std::strncmp(svgFileToInvert, "/DrumKit/", 9) == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
paint.type = NSVG_PAINT_COLOR; |
|
|
|
|
|
paint.color = 0xff191919; |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
// Special case for PathSet shifty gradient |
|
|
|
|
|
if (std::strncmp(svgFileToInvert, "/PathSet/", 9) == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
paint.gradient->stops[0].color = 0xff7c4919; // 50% darker than main blue |
|
|
|
|
|
paint.gradient->stops[1].color = 0xff5b3a1a; // 33.3% darker than main blue |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (paint.type == NSVG_PAINT_NONE) |
|
|
if (paint.type == NSVG_PAINT_NONE) |
|
@@ -342,39 +352,58 @@ static inline bool invertPaint(NSVGpaint& paint, const char* const svgFileToInve |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Special case for Path Set colors |
|
|
|
|
|
|
|
|
// Special case for PathSet colors |
|
|
if (svgFileToInvert != nullptr && std::strncmp(svgFileToInvert, "/PathSet/", 9) == 0) |
|
|
if (svgFileToInvert != nullptr && std::strncmp(svgFileToInvert, "/PathSet/", 9) == 0) |
|
|
{ |
|
|
{ |
|
|
switch (paint.color) |
|
|
switch (paint.color) |
|
|
{ |
|
|
{ |
|
|
// do nothing |
|
|
|
|
|
|
|
|
// main blue tone |
|
|
case 0xffdf7a1a: |
|
|
case 0xffdf7a1a: |
|
|
case 0xffe3b080: |
|
|
|
|
|
case 0xffe941e2: |
|
|
|
|
|
|
|
|
if (shape->opacity == 0.5f && std::strcmp(svgFileToInvert, "/PathSet/res/AstroVibe.svg") == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
shape->opacity = 0.2f; |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
if (shape->opacity == 0.25f) |
|
|
|
|
|
shape->opacity = 0.75f; |
|
|
|
|
|
return false; |
|
|
|
|
|
// bottom logo stuff, set to full white |
|
|
|
|
|
case 0xff000000: |
|
|
|
|
|
if (shape->stroke.type != NSVG_PAINT_NONE) |
|
|
|
|
|
{ |
|
|
|
|
|
paint.color = 0xffffffff; |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
// pink step 2 (pink with 50% opacity on bg) |
|
|
case 0xffef73ea: |
|
|
case 0xffef73ea: |
|
|
|
|
|
paint.color = 0xff812d7d; |
|
|
|
|
|
return true; |
|
|
|
|
|
// pink step 3 (pink with 33.3% opacity on bg) |
|
|
case 0xfff49ff0: |
|
|
case 0xfff49ff0: |
|
|
|
|
|
paint.color = 0xff4d234c; |
|
|
|
|
|
return true; |
|
|
|
|
|
// pink and orange |
|
|
|
|
|
case 0xffe941e2: |
|
|
case 0xff698efb: |
|
|
case 0xff698efb: |
|
|
case 0xff787878: |
|
|
|
|
|
case 0xfff5c99f: |
|
|
|
|
|
case 0xffde944f: |
|
|
|
|
|
case 0xffe1a265: |
|
|
|
|
|
case 0xffe5cbb3: |
|
|
|
|
|
case 0xffe6d2c0: |
|
|
|
|
|
case 0xffffffff: |
|
|
|
|
|
return false; |
|
|
return false; |
|
|
// set other colors |
|
|
|
|
|
|
|
|
// blue darker 1 (blue with 50% opacity on bg) |
|
|
|
|
|
case 0xffde944f: |
|
|
|
|
|
case 0xffe3b080: |
|
|
case 0xffe4cbb3: |
|
|
case 0xffe4cbb3: |
|
|
paint.color = 0xffe3b080; |
|
|
|
|
|
return false; |
|
|
|
|
|
case 0xfff8dcc2: |
|
|
|
|
|
paint.color = 0xffde944f; |
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
case 0xfff5c99f: |
|
|
|
|
|
case 0xfff6d1b0: |
|
|
|
|
|
paint.color = 0xff7c4919; |
|
|
|
|
|
return true; |
|
|
|
|
|
// blue darker 2 (blue with 33.3% opacity on bg) |
|
|
case 0xffe5d9cd: |
|
|
case 0xffe5d9cd: |
|
|
paint.color = 0xfff8dcc2; |
|
|
|
|
|
return false; |
|
|
|
|
|
// should be just the logo, but also changes the output outlines |
|
|
|
|
|
case 0xff000000: |
|
|
|
|
|
paint.color = 0xffffffff; |
|
|
|
|
|
|
|
|
case 0xfff8dcc2: |
|
|
|
|
|
case 0xffe1a265: |
|
|
|
|
|
paint.color = 0xff5b3a1a; |
|
|
|
|
|
return true; |
|
|
|
|
|
// blue darker 3 (blue with 25% opacity on bg) |
|
|
|
|
|
case 0xffe5cbb3: |
|
|
|
|
|
paint.color = 0xff4b321a; |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -460,8 +489,8 @@ NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* con |
|
|
if (ignore) |
|
|
if (ignore) |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
if (invertPaint(shape->fill, svgFileToInvert)) |
|
|
|
|
|
invertPaint(shape->stroke, svgFileToInvert); |
|
|
|
|
|
|
|
|
if (invertPaint(shape, shape->fill, svgFileToInvert)) |
|
|
|
|
|
invertPaint(shape, shape->stroke, svgFileToInvert); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return handle; |
|
|
return handle; |
|
|