]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vt(4): Colors are indexed against a console palette, not a VGA palette
authordumbbell <dumbbell@FreeBSD.org>
Thu, 21 Aug 2014 10:18:42 +0000 (10:18 +0000)
committerdumbbell <dumbbell@FreeBSD.org>
Thu, 21 Aug 2014 10:18:42 +0000 (10:18 +0000)
commit9ac8060e5711317f8497c0f9c9e623976d50560f
tree9857b66e11d5d2c4491f9f808b5ca53979afcff1
parent644cd5de6d91256b5541170968a9f8ddcd2e6ee5
vt(4): Colors are indexed against a console palette, not a VGA palette

Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).

The main differences between both orders are:
    o  Blue and red are swapped (1 <-> 4)
    o  Yellow and cyan are swapped (3 <-> 6)

The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.

While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).

This is an MFC of r269783 and r269791.
sys/arm/freescale/imx/imx51_ipuv3_fbd.c
sys/dev/vt/colors/vt_termcolors.c
sys/dev/vt/colors/vt_termcolors.h
sys/dev/vt/hw/efifb/efifb.c
sys/dev/vt/hw/fb/vt_early_fb.c
sys/dev/vt/hw/fb/vt_fb.c
sys/dev/vt/hw/ofwfb/ofwfb.c