Skip to content

Commit

Permalink
fix bg css
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Oct 17, 2024
1 parent 0412819 commit a0ad71a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ansi2/src/css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) fn to_style(theme: impl ColorTable, ty: CssType, mode: Option<Mode>)
let mut color256bg = Vec::new();
for (i, (r, g, b)) in COLOR256.iter().enumerate() {
color256bg.push(format!(
".color256_bg_{i}{{ {bg_field}: rgb({r},{g},{b}) ;}}"
".bg-color256_{i}{{ {bg_field}: rgb({r},{g},{b}) ;}}"
));
}

Expand Down
7 changes: 6 additions & 1 deletion ansi2/src/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,17 @@ fn parse_sgr6(input: &str) -> IResult<&str, Token> {
}

if ctrl == 48 && ty == 5 && g == 38 && b == 5 {
return Ok((
rem,
Token::ColorFgBg(AnsiColor::Color256(n), AnsiColor::Color256(r)),
));
}
if ctrl == 38 && ty == 5 && g == 48 && b == 5 {
return Ok((
rem,
Token::ColorFgBg(AnsiColor::Color256(r), AnsiColor::Color256(n)),
));
}

todo!()
}
fn parse_sgr10(input: &str) -> IResult<&str, Token> {
Expand Down

0 comments on commit a0ad71a

Please sign in to comment.