diff --git a/afmt.odin b/afmt.odin index e8c6684..e5478c3 100644 --- a/afmt.odin +++ b/afmt.odin @@ -1811,9 +1811,9 @@ rgb_to_8bit :: proc(rgb: RGB) -> (color: u8) { case {128, 255, 255}: return 14 case {255, 255, 255}: return 15 case: - for color in u8(232)..=u8(255) { - if rgb == {008, 008, 008} + ((color - 232) * 10) { - return color + for _color in u8(232)..=u8(255) { + if rgb == {008, 008, 008} + ((_color - 232) * 10) { + return _color } } } diff --git a/afmt_posix.odin b/afmt_posix.odin index 5fca398..9495815 100644 --- a/afmt_posix.odin +++ b/afmt_posix.odin @@ -1,8 +1,6 @@ #+build !windows package afmt -import "core:sys/posix" - @(private) _set_utf8_terminal :: proc() {} diff --git a/colors.odin b/colors.odin index 828c818..ab62b8d 100644 --- a/colors.odin +++ b/colors.odin @@ -73,7 +73,7 @@ print_color_guide :: proc(groups: bit_set[Color_Group] = {.all}, bg := true) { } cols[1].ansi = cols[0].ansi cols[2].ansi = cols[0].ansi - name := tprintf(" %s", color_name_from_enum(id)) + name = tprintf(" %s", color_name_from_enum(id)) rgb := tprintf("%3i %3i %3i", c.r, c.g, c.b) hsl_ := hsl(c) hsls := tprintf("%6.2f %.2f %.2f", hsl_[0], hsl_[1], hsl_[2]) @@ -117,7 +117,7 @@ print_color_guide_ex :: proc(groups: bit_set[Color_Group] = {.all}, bg := true, } cols[1].ansi = cols[0].ansi cols[2].ansi = cols[0].ansi - name := tprintf(" %s", color_name_from_enum(id)) + name = tprintf(" %s", color_name_from_enum(id)) rgb := tprintf("%3i %3i %3i", c.r, c.g, c.b) hsl_ := hsl(c) hsls := tprintf("%6.2f %.2f %.2f", hsl_[0], hsl_[1], hsl_[2])