Difference between revisions of "Forum:Color of the player"

From NetHackWiki
Jump to navigation Jump to search
(it's bold white on default background, which looks very strange if the default background is white)
(bump thread up. The forum move accidentally made very old threads new.)
 
Line 1: Line 1:
 
{{Forumheader|Watercooler}}
 
{{Forumheader|Watercooler}}
  
<!-- Please put your content under this line.  Be sure to sign your edits with four tildes ~~~~ -->
+
<!--- Please put your content under this line.  Be sure to sign your edits with four tildes ~~~~ -->
  
 
Hello everybody, I'm coding a small roguelike (just a hobby) and I'd like to know what the colors used for displaying the character (@) and its background are, as I haven't been able to find them through source-diving. Does anybody have more info ?
 
Hello everybody, I'm coding a small roguelike (just a hobby) and I'd like to know what the colors used for displaying the character (@) and its background are, as I haven't been able to find them through source-diving. Does anybody have more info ?
 
:The foreground is bold white; the background is the default background that you get if you send the code to turn the background off (ESC [ 49 m), which on most terminals is black, or a similar color. Some terminals use white as a background instead, in which case NetHack does indeed draw white on white. (Note that with typical color codes, making a color bold changes its color, e.g. yellow is yellow only if bolded, and brown otherwise.) For source-diving purposes, the color is HI_DOMESTIC, defined in src/map_glyph.c; the colors themselves are defined in include/color.h, in terms of the IBM PC color codes. (This assumes a win/tty/wintty.c drawing method to the screen; most of the other methods don't use the @ symbol for the player anyway.) [[User:Ais523|Ais523]] 21:10, 28 November 2010 (UTC)
 
:The foreground is bold white; the background is the default background that you get if you send the code to turn the background off (ESC [ 49 m), which on most terminals is black, or a similar color. Some terminals use white as a background instead, in which case NetHack does indeed draw white on white. (Note that with typical color codes, making a color bold changes its color, e.g. yellow is yellow only if bolded, and brown otherwise.) For source-diving purposes, the color is HI_DOMESTIC, defined in src/map_glyph.c; the colors themselves are defined in include/color.h, in terms of the IBM PC color codes. (This assumes a win/tty/wintty.c drawing method to the screen; most of the other methods don't use the @ symbol for the player anyway.) [[User:Ais523|Ais523]] 21:10, 28 November 2010 (UTC)

Latest revision as of 21:58, 6 December 2010


Hello everybody, I'm coding a small roguelike (just a hobby) and I'd like to know what the colors used for displaying the character (@) and its background are, as I haven't been able to find them through source-diving. Does anybody have more info ?

The foreground is bold white; the background is the default background that you get if you send the code to turn the background off (ESC [ 49 m), which on most terminals is black, or a similar color. Some terminals use white as a background instead, in which case NetHack does indeed draw white on white. (Note that with typical color codes, making a color bold changes its color, e.g. yellow is yellow only if bolded, and brown otherwise.) For source-diving purposes, the color is HI_DOMESTIC, defined in src/map_glyph.c; the colors themselves are defined in include/color.h, in terms of the IBM PC color codes. (This assumes a win/tty/wintty.c drawing method to the screen; most of the other methods don't use the @ symbol for the player anyway.) Ais523 21:10, 28 November 2010 (UTC)