git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] color: add support for 12-bit RGB colors

From
Jeff King <peff@peff.net>
Date
Apr 30, 2024, 10:57 UTC
Message-ID
<20240430105727.GI1279403@coredump.intra.peff.net>
In-Reply-To
<20240429164849.78509-4-dev+git@drbeat.li>
On Mon, Apr 29, 2024 at 06:48:49PM +0200, Beat Bolli wrote:
Show 5 quoted lines
> -test_expect_success '24-bit colors' '
> -	color "#ff00ff black" "[38;2;255;0;255;40m"
> +test_expect_success 'RGB colors' '
> +	color "#ff00ff #0f0" "[38;2;255;0;255;48;2;0;255;0m"
>  '

Heh, I would still think of it as a shorthand for 24-bit color, but I guess you could argue it is now 12-bit color. :)

(Only observing, I think the new name is fine).
Show 11 quoted lines
>  test_expect_success '"default" foreground' '
> @@ -146,7 +146,10 @@ test_expect_success 'non-hex character in RGB color' '
>  	invalid_color "#12x456" &&
>  	invalid_color "#123x56" &&
>  	invalid_color "#1234x6" &&
> -	invalid_color "#12345x"
> +	invalid_color "#12345x" &&
> +	invalid_color "#x23" &&
> +	invalid_color "#1x3" &&
> +	invalid_color "#12x"
>  '

This made me wonder what we'd do with "#1", "#12", "#1234", etc. Looking at the code change, I think we'd continue to reject them. I wonder if it is worth covering here.

-Peff
Previous: Beat BolliNext: Junio C Hamano
Message 8 of 13 in “color: add support for 12-bit RGB colors”
  1. 0/3 color: add support for 12-bit RGB colorsBeat Bolli, Apr 29, 2024
  2. 1/3 t/t4026-color: remove an extra double quote characterBeat Bolli, Apr 29, 2024
  3. Jeff KingApr 30, 2024
  4. 2/3 t/t4026-color: add test coverage for invalid RGB colorsBeat Bolli, Apr 29, 2024
  5. 3/3 color: add support for 12-bit RGB colorsBeat Bolli, Apr 29, 2024
  6. Junio C HamanoApr 29, 2024
  7. Beat BolliApr 29, 2024
  8. Jeff KingApr 30, 2024
  9. Junio C HamanoApr 30, 2024
  10. Junio C HamanoApr 30, 2024
  11. Junio C HamanoApr 30, 2024
  12. Jeff KingMay 3, 2024
  13. Taylor BlauApr 29, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.