Use a Printable struct for ansi rgb formatting instead of explicit allocations (#2696)

* Use a `Printable` struct for ansi rgb formatting

* update release notes

* Some renaming.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Book-reader
2026-01-16 10:26:18 +13:00
committed by GitHub
parent 3f7a547d8a
commit cd2d1a04d8
3 changed files with 41 additions and 7 deletions

View File

@@ -18,8 +18,9 @@ fn void test_color()
test::eq("\u001B[48;2;255;204;255m", ansi::color(0xFFCCFF, true));
}
fn void test_make_color()
fn void test_get_color()
{
test::eq("\u001B[38;2;255;204;255m", ansi::make_color(tmem, 0xFFCCFF));
test::eq("\u001B[48;2;255;204;255m", ansi::make_color(tmem, 0xFFCCFF, true));
test::eq("\u001B[38;2;255;204;254m", string::tformat("%s", ansi::get_color_rgb(0xFF, 0xCC, 0xFE)));
test::eq("\u001B[38;2;255;204;254m", string::tformat("%s", ansi::get_color(0xFFCCFE)));
test::eq("\u001B[48;2;255;204;254m", string::tformat("%s", ansi::get_color(0xFFCCFE, true)));
}