vty
vty copied to clipboard
Bright colors printed as non-bright

module Main where
import Lib
import Graphics.Vty
main = do
cfg <- standardIOConfig
vty <- mkVty cfg
let line0 = string (defAttr `withForeColor` green `withBackColor` brightGreen) "first line"
line0d = string defAttr " <- green on brightGreen"
line1 = string (defAttr `withForeColor` brightBlack `withBackColor` black) "second line"
line1d = string defAttr " <- brightBlack on black"
img = line0 <|> line0d <-> line1 <|> line1d
pic = picForImage img
update vty pic
e <- nextEvent vty
shutdown vty
print ("Last event was: " ++ show e)
Terminal emulator is Terminology 1.2.1 and it supports bright colors (screenshot of colortest-16):

Library version is 5.25.1 (I am using Stack).
Thanks for the report! What produced the second image?
It's colortest-16 from colortest package in Ubuntu. I wasn't able to find exact same version online, so here's a gist - https://gist.github.com/mnn/f8a6e2b1b3e938f08cd2ebce36f85d28.
Thanks. Have you reproduced this with any other terminal emulators?
I am experiencing same issue with konsole and xterm. gnome-terminal is ok. All of them render the colortest-16 correctly.
From top: terminology, konsole, xterm, gnome-terminal (white is mapped to green, it's not a bug)
While my color scheme is solarized and things look a little different than you might expect, vty successfully distinguishes the bright and non-bright colors on Terminal.app. What TERM value are you using?
When I'm using TERM=xterm-256color I get the following image:
When I'm using TERM=xterm, however, I get:
Yes, TERM=xterm seems to be the cause. According to this it is not possible in many terminal emulators to get info about supported colors. Script from comments returns in terminology with default settings 8. After enabling option Set TERM to xterm-256color bright colors work.
Is is possible in vty enforce using 16 colors (ignoring TERM env var)?
@mnn It is possible to force Vty into 16-color mode:
vty <- mkVty defaultConfig
let vty16ColorMode = vty { outputIface = (outputIface vty) { contextColorCount = 16 } }
I'm going to close this due to inactivity, but please re-open this or file a more specific issue if needed. Thanks!