summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-10-15 15:56:27 -0700
committerJoe Wilm <joe@jwilm.com>2016-10-15 15:56:27 -0700
commitd4c1d51e36626b1682b96e746bb32632dadcac2c (patch)
tree83d1f06ee6019ac5488c3559dbe8c248db1a44f8 /src/renderer
parent71de5501c450eeaa363aa5403a5258d231d64935 (diff)
downloadalacritty-d4c1d51e36626b1682b96e746bb32632dadcac2c.tar.gz
alacritty-d4c1d51e36626b1682b96e746bb32632dadcac2c.zip
Make colors configurable from file
Added solarized dark color scheme for testing purposes. Resolves #1.
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/mod.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index 23157456..7ddf1d01 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -610,11 +610,13 @@ impl<'a> RenderApi<'a> {
}
/// Render a string in a predefined location. Used for printing render time for profiling and
/// optimization.
- pub fn render_string(&mut self,
- s: &str,
- glyph_cache: &mut GlyphCache,
- color: &Rgb)
- {
+ pub fn render_string(
+ &mut self,
+ bg: &Rgb,
+ s: &str,
+ glyph_cache: &mut GlyphCache,
+ color: &Rgb,
+ ) {
let row = 40.0;
let mut col = 100.0;
@@ -629,7 +631,7 @@ impl<'a> RenderApi<'a> {
let cell = Cell {
c: c,
fg: *color,
- bg: term::DEFAULT_BG,
+ bg: *bg,
flags: cell::INVERSE,
};
self.add_render_item(row, col, &cell, glyph);
@@ -656,12 +658,12 @@ impl<'a> RenderApi<'a> {
}
}
- pub fn render_grid(&mut self, grid: &Grid<Cell>, glyph_cache: &mut GlyphCache) {
+ pub fn render_grid(&mut self, bg: &Rgb, grid: &Grid<Cell>, glyph_cache: &mut GlyphCache) {
for (i, line) in grid.lines().enumerate() {
for (j, cell) in line.cells().enumerate() {
// Skip empty cells
if cell.c == ' ' &&
- cell.bg == term::DEFAULT_BG &&
+ cell.bg == *bg &&
!cell.flags.contains(cell::INVERSE)
{
continue;