> Strictly speaking, <ESC>[40m means "set background to the > colour specified in slot zero of the colour palette"; on > most terminals that happens to be black.
Yes, that's why I said "normally". However, viewing the numbers as indices into a palette that can be remapped may be a feature of the more modern terminals. There are a number of standards (e.g., ISO 6429 or ECMA-48) where the colors are understood to be fixed. (By the way, it's easy to remember which number corresponds to which color by viewing it as a three-bit "true color" representation -- bit 0 = 1 = red, bit 1 = 2 = green, and bit 2 = 4 = blue; then simply add up the desired components.) Coming back to the original problem, I think this is due to a "misunderstanding" between pic and grotty. Groff knows a "glyph color" and a "fill color"; in grotty, these are equated to "foreground color" and "background color". (On non-character-cell devices, the concept of a "background color" may not be meaningful, since there is no obvious way to define the "background area" of a glyph -- e.g., does it correspond to the bounding box or does it extend from baseline to baseline?) Anyhow, pic sets the fill color to black for filling the arrowheads, and from that point on grotty writes all text with a black background. The fix appears to be rather easy: let pic set the fill color not to black (\D'Fg 0.000'), but to "default" (\D'Fd'); this seems to work correctly with grops and also lets grotty write the text normally.
