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