diff --git a/main.cpp b/main.cpp index bf9f2b4..adf596a 100644 --- a/main.cpp +++ b/main.cpp @@ -78,11 +78,11 @@ int main(int argc, char* argv[]) string color = "base"; Input in; if (argc > 1) { - for (size_t i = 0; i < argc; i += 1){ + for (size_t i = 0; i < argc; i++){ if (strcmp(argv[i], "-fill") == 0){ if (i - 1 < 1){ in = download(argv[i + 2]); - color = argv[i + 2]; + color = argv[i + 1]; } else{ if (i + 1 >= argc){ diff --git a/svg.cpp b/svg.cpp index 2e89986..b68fc28 100644 --- a/svg.cpp +++ b/svg.cpp @@ -51,7 +51,7 @@ show_histogram_svg(const vector& bins, const std::vector& border const auto BIN_HEIGHT = 30; const auto BLOCK_WIDTH = 10; const auto MAX_WIDTH = IMAGE_WIDTH-TEXT_WIDTH; - vector colors = {"red", "blue", "gold", "lime", "aqua", "green", "orange"}; + vector colors = {"white", "red", "blue", "gold", "lime", "aqua", "green", "orange"}; size_t border = 0; size_t number_of_blocks; @@ -59,7 +59,6 @@ show_histogram_svg(const vector& bins, const std::vector& border size_t max_bin = *max_element(bins.begin(), bins.end()); double top = 0; - size_t paint_swicher = 0; string color; double max_count = bins[0]; for (size_t i = 0; i < bins.size(); i++) @@ -74,9 +73,10 @@ show_histogram_svg(const vector& bins, const std::vector& border { if (filling != "base"){ color = filling; + } - else{ - color = colors[paint_swicher]; + else { + color = colors[0]; } number_of_blocks = bin; if ((max_bin * BLOCK_WIDTH) > (IMAGE_WIDTH - TEXT_WIDTH)){ @@ -85,10 +85,6 @@ show_histogram_svg(const vector& bins, const std::vector& border const double bin_width = BLOCK_WIDTH * number_of_blocks; svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, "black", color); - paint_swicher += 1; - if (paint_swicher > 6){ - paint_swicher = 0; - } if (border < bin_count - 1){ top += BIN_HEIGHT; svg_text(TEXT_LEFT / 2, top + TEXT_BASELINE , to_string(borders[border]));