[thg] Color extension - Specify "bold" background

Steve Borho steve at borho.org
Fri May 7 20:11:58 UTC 2010


On Fri, May 7, 2010 at 2:37 PM, Stanimir Stamenkov <s7an10 at netscape.net> wrote:
> Fri, 7 May 2010 13:31:07 -0500, /Steve Borho/:
>>
>> On Fri, May 7, 2010 at 1:28 PM, Steve Borho <steve at borho.org> wrote:
>>>
>>> On Fri, May 7, 2010 at 1:23 PM, Stanimir Stamenkov <s7an10 at netscape.net>
>>> wrote:
>>>
>>>> but only:
>>>>
>>>>    w32effects = {
>>>>        ...
>>>>        'black_background': 0,
>>>>        'red_background': BACKGROUND_RED,
>>>>        'green_background': BACKGROUND_GREEN,
>>>>        'blue_background': BACKGROUND_BLUE,
>>>>        'cyan_background': BACKGROUND_BLUE | BACKGROUND_GREEN,
>>>>        ...
>>>>
>>>> Is there a particular reason the 'yellow', 'purple' and 'white'
>>>> backgrounds are omitted for the win32 console?
>>>
>>> I didn't find them here:
>>>
>>> http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx
>>
>> I'll also say I didn't experiment much with OR'ing all the combinations.
>> If you find a combination that works for any of those other tags, let me
>> know and I'll be glad to add them.
>
> I've recently tried out the Win32 Console APIs (see "unicode_test.cpp"
> attached) for other than the color attributes but tried them too, and I can
> see all background color combinations are effective.  I guess one just need
> to add these:
>
> diff -r 502474839293 hgext/color.py
> --- a/hgext/color.py    Wed May 05 20:21:57 2010 -0500
> +++ b/hgext/color.py    Fri May 07 22:15:15 2010 +0300
> @@ -235,8 +235,11 @@
>         'black_background': 0,
>         'red_background': BACKGROUND_RED,
>         'green_background': BACKGROUND_GREEN,
> +        'yellow_background': BACKGROUND_RED | BACKGROUND_GREEN,
>         'blue_background': BACKGROUND_BLUE,
> +        'purple_background': BACKGROUND_BLUE | BACKGROUND_RED,
>         'cyan_background': BACKGROUND_BLUE | BACKGROUND_GREEN,
> +        'white_background': BACKGROUND_RED | BACKGROUND_GREEN |
> BACKGROUND_BLUE,
>         'bold_background': BACKGROUND_INTENSITY,
>         'underline': COMMON_LVB_UNDERSCORE,     # double-byte charsets only
>         'inverse': COMMON_LVB_REVERSE_VIDEO,    # double-byte charsets only

Those do seem to work.  I'll push the change to crew.

Thanks for investigating.

--
Steve Borho



More information about the Mercurial mailing list