From 8ab0c9fa017b5ead2e3f5cfc892b242cd0bbc908 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 21 Jun 2023 15:39:46 +0200 Subject: Make warning messages in color handling code easier to understand --- svg-flatten/src/svg_color.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'svg-flatten/src/svg_color.cpp') diff --git a/svg-flatten/src/svg_color.cpp b/svg-flatten/src/svg_color.cpp index 87aae3a..f2ae8eb 100644 --- a/svg-flatten/src/svg_color.cpp +++ b/svg-flatten/src/svg_color.cpp @@ -64,6 +64,10 @@ enum gerber_color gerbolyze::svg_color_to_gerber(string color, string opacity, e if (alpha < 0.5f) { //cerr << " -> none" << endl; + if (alpha > 0.01) { + cerr << "Info: Found an object with opacity set to " << alpha << ". This object will be omitted from the output." << endl; + } + return GRB_NONE; } @@ -74,6 +78,10 @@ enum gerber_color gerbolyze::svg_color_to_gerber(string color, string opacity, e //cerr << " -> dark" << endl; return GRB_DARK; } + + if (hsv.v >= 0.4 && hsv.v <= 0.6) { + cerr << "Warning: color \"" << color << "\" is ambiguous. Gerbolyze decides whether to map colors to clear or dark polarity by checking if their HSV value (i.e. brightness) is above 50 %. This color has a value of " << hsv.v << ", close to 50 %." << endl; + } } //cerr << " -> dark" << endl; -- cgit