Skip to content

Commit

Permalink
[FIXED] input opacity != 255 would now be kept
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Göker committed Nov 17, 2017
1 parent 0d74ee4 commit ffe826e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions table2itol.R
Expand Up @@ -140,7 +140,7 @@ if (!interactive() || length(find.package("optparse", NULL, TRUE))) {

), add_help_option = FALSE, prog = "table2itol.R",
usage = "%prog [options] file1 file2 ...", description = "
%prog: converting spreadsheet files to iTOL input, version 2.5.0",
%prog: converting spreadsheet files to iTOL input, version 2.5.1",
epilogue = "
FREQUENTLY NEEDED OPTIONS:
Expand Down Expand Up @@ -492,9 +492,9 @@ create_itol_files <- function(infiles, identifier = "ID", label = "Label",

standardize_colour <- function(x, opacity) {
x <- grDevices::col2rgb(x, TRUE)
alpha <- if (opacity < 1) as.integer(x["alpha", ] * opacity) else NULL
tolower(grDevices::rgb(x["red", ], x["green", ],
x["blue", ], alpha, NULL, 255L))
x["alpha", ] <- as.integer(x["alpha", ] * opacity)
tolower(grDevices::rgb(x["red", ], x["green", ], x["blue", ],
if (all(x["alpha", ] == 255L)) NULL else x["alpha", ], NULL, 255L))
}


Expand Down
2 changes: 1 addition & 1 deletion tests/table2itol_help.txt
@@ -1,6 +1,6 @@
Usage: table2itol.R [options] file1 file2 ...

table2itol.R: converting spreadsheet files to iTOL input, version 2.5.0
table2itol.R: converting spreadsheet files to iTOL input, version 2.5.1

Options:
-a, --abort
Expand Down

0 comments on commit ffe826e

Please sign in to comment.