Skip to content

Commit

Permalink
Fix wrong fc color color in 256color example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgardona committed Jan 9, 2024
1 parent b6bf63a commit 1ce7c5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/256color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::{
io::{Read, Seek},
};

use ansistream::{FC_WHITE, FC_BLACK};

fn flush<R: Read + Seek, W: Write>(reader: &mut R, writer: &mut W) -> std::io::Result<()> {
reader.seek(std::io::SeekFrom::Start(0))?;
std::io::copy(reader, writer)?;
Expand Down Expand Up @@ -53,13 +55,13 @@ fn main() -> std::io::Result<()> {

for i in 0..=23 {
if i < 12 {
fg = 255;
fg = FC_WHITE;
} else {
fg = 0;
fg = FC_BLACK;
}

let ie = i + 232;
astream.write_attribute(fg)?;
astream.write_text_fc(fg, "")?;
astream.write_text_bc256_fmt(ie, format_args!("{ie:<4}"))?;
}

Expand Down
Binary file modified images/256color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1ce7c5a

Please sign in to comment.