Skip to content

Commit

Permalink
Merge pull request thestinger#400 from jelly/assert_valid_color
Browse files Browse the repository at this point in the history
load_theme: set alpha to 0 of GdkRGBA
  • Loading branch information
jelly authored Oct 2, 2016
2 parents ea0bc59 + 80ab246 commit a9cecb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions termite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,7 @@ static void load_theme(GtkWindow *window, VteTerminal *vte, GKeyFile *config, hi
palette[i].blue = (((i & 4) ? 0xc000 : 0) + (i > 7 ? 0x3fff: 0)) / 65535.0;
palette[i].green = (((i & 2) ? 0xc000 : 0) + (i > 7 ? 0x3fff : 0)) / 65535.0;
palette[i].red = (((i & 1) ? 0xc000 : 0) + (i > 7 ? 0x3fff : 0)) / 65535.0;
palette[i].alpha = 0;
} else if (i < 232) {
const unsigned j = i - 16;
const unsigned r = j / 36, g = (j / 6) % 6, b = j % 6;
Expand All @@ -1288,9 +1289,11 @@ static void load_theme(GtkWindow *window, VteTerminal *vte, GKeyFile *config, hi
palette[i].red = (red | red << 8) / 65535.0;
palette[i].green = (green | green << 8) / 65535.0;
palette[i].blue = (blue | blue << 8) / 65535.0;
palette[i].alpha = 0;
} else if (i < 256) {
const unsigned shade = 8 + (i - 232) * 10;
palette[i].red = palette[i].green = palette[i].blue = (shade | shade << 8) / 65535.0;
palette[i].alpha = 0;
}
}

Expand Down

0 comments on commit a9cecb4

Please sign in to comment.