diff options
author | jakobst1n <jakob.stendahl@outlook.com> | 2024-06-12 17:15:34 +0200 |
---|---|---|
committer | jakobst1n <jakob.stendahl@outlook.com> | 2024-06-12 17:15:34 +0200 |
commit | 0bf1314357af48d97790069679f451b53862f276 (patch) | |
tree | 7cd33fbc5f5cceac542883411ff83235f8ad9f90 | |
parent | 04032a7b1385833e9c7a38c3dc633c72d85ae213 (diff) | |
download | textgraph-0bf1314357af48d97790069679f451b53862f276.tar.gz textgraph-0bf1314357af48d97790069679f451b53862f276.zip |
Add color to braille and star mode by default
-rw-r--r-- | src/graph.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/graph.rs b/src/graph.rs index a2554f0..1b76ea3 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -382,7 +382,7 @@ impl GraphBuilder { fn draw_star(&mut self, g: usize) { for i in 0..self.y_values[g].len() { let y = self.draw_height - (self.y_values[g][i] as usize) - 1; - self.draw(i, y, GraphPixel::Normal('*')); + self.draw(i, y, self.color_pixel('*', |px| GraphPixel::Green(px))); } } @@ -437,12 +437,12 @@ impl GraphBuilder { if y1_abs == y2_abs { let pxx = (1 << (y1 % 3)) | (1 << ((y2 % 3) + 3)); - self.draw(i / 2, y1_abs, GraphPixel::Normal(brc6(pxx))); + self.draw(i / 2, y1_abs, self.color_pixel(brc6(pxx), |px| GraphPixel::Green(px))); } else { let pxx1 = 1 << (y1 % 3); - self.draw(i / 2, y1_abs, GraphPixel::Normal(brc6(pxx1))); + self.draw(i / 2, y1_abs, self.color_pixel(brc6(pxx1), |px| GraphPixel::Green(px))); let pxx2 = 1 << ((y2 % 3) + 3); - self.draw(i / 2, y2_abs, GraphPixel::Normal(brc6(pxx2))); + self.draw(i / 2, y2_abs, self.color_pixel(brc6(pxx2), |px| GraphPixel::Green(px))); } i += 2; } |