diff --git a/src/algorithms/atomic_image.cpp b/src/algorithms/atomic_image.cpp index 870e2759..255185e1 100644 --- a/src/algorithms/atomic_image.cpp +++ b/src/algorithms/atomic_image.cpp @@ -99,10 +99,20 @@ std::string to_rgba(const color_t& c) { ss << (int)c.c.r << ","; ss << (int)c.c.g << ","; ss << (int)c.c.b << ","; - ss << (int)c.c.a << ")"; + ss << (int)1 << ")"; return ss.str(); } +std::string to_hexrgb(const color_t& c) { + std::stringstream ss; + ss << "#"; + ss << std::hex << std::uppercase; // Use hexadecimal format + ss << std::setfill('0') << std::setw(2) << (int)c.c.r; + ss << std::setfill('0') << std::setw(2) << (int)c.c.g; + ss << std::setfill('0') << std::setw(2) << (int)c.c.b; + return ss.str(); +} + // helpers double u_ipart(double x) { return std::floor(x); } diff --git a/src/algorithms/atomic_image.hpp b/src/algorithms/atomic_image.hpp index 05472902..8a6399ed 100644 --- a/src/algorithms/atomic_image.hpp +++ b/src/algorithms/atomic_image.hpp @@ -95,6 +95,7 @@ color_t mix(const color_t& a, const color_t& b, const double& f); std::string to_hex(const color_t& c); std::string to_rgba(const color_t& c); +std::string to_hexrgb(const color_t& c); const color_t COLOR_BLACK = { 0xff000000 }; const color_t COLOR_LIGHTGRAY = { 0xffD3D3D3 }; diff --git a/src/algorithms/draw.cpp b/src/algorithms/draw.cpp index 7d606c8f..4baed774 100644 --- a/src/algorithms/draw.cpp +++ b/src/algorithms/draw.cpp @@ -149,7 +149,7 @@ void draw_svg(std::ostream &out, << (Y[a] * scale) + y_off << "\" y2=\"" << (Y[a + 1] * scale) + y_off - << "\" stroke=\"" << to_rgba(color) + << "\" stroke=\"" << to_hexrgb(color) //to_rgba(color) // with rgb, nodes are invisible with InkScape << "\" stroke-width=\"" << line_width << "\"/>" << std::endl; diff --git a/src/subcommand/draw_main.cpp b/src/subcommand/draw_main.cpp index 4c5f6ff2..a42e18d6 100644 --- a/src/subcommand/draw_main.cpp +++ b/src/subcommand/draw_main.cpp @@ -43,7 +43,7 @@ int main_draw(int argc, char **argv) { args::Flag color_paths(visualizations_opts, "color-paths", "Color paths (in PNG output).", {'C', "color-paths"}); args::ValueFlag render_scale(visualizations_opts, "N", "Image scaling (default 0.001).", {'R', "scale"}); args::ValueFlag render_border(visualizations_opts, "N", "Image border (in approximate bp) (default 100.0).", {'B', "border"}); - args::ValueFlag png_line_width(visualizations_opts, "N", "Line width (in approximate bp) (default 20.0).", {'w', "line-width"}); + args::ValueFlag png_line_width(visualizations_opts, "N", "Line width (in approximate bp) (default 10.0).", {'w', "line-width"}); //args::ValueFlag png_line_overlay(parser, "N", "line width (in approximate bp) (default 10.0)", {'O', "line-overlay"}); args::ValueFlag png_path_line_spacing(visualizations_opts, "N", "Spacing between path lines in PNG layout (in approximate bp) (default 0.0).", {'S', "path-line-spacing"}); args::ValueFlag _path_bed_file(visualizations_opts, "FILE", @@ -171,7 +171,7 @@ int main_draw(int argc, char **argv) { } const uint64_t _png_height = png_height ? args::get(png_height) : 1000; - const double _png_line_width = png_line_width ? args::get(png_line_width) : 20.0; + const double _png_line_width = png_line_width ? args::get(png_line_width) : 10.0; const bool _color_paths = args::get(color_paths); const double _png_path_line_spacing = png_path_line_spacing ? args::get(png_path_line_spacing) : 0.0; const double svg_scale = !render_scale ? 0.01 : args::get(render_scale);