Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: COLORS Date: Sat, 31 May 2014 18:00:40 -0400 Organization: Aioe.org NNTP Server Lines: 37 Message-ID: References: <7b87e201-c207-4c3a-8034-0b96190345db@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:31097 On Sat, 31 May 2014 16:52:42 -0400, Mark Wills wrote: > On Saturday, 31 May 2014 18:45:43 UTC+1, Jason Damisch wrote: >> COLORS NORMAL INVERSE RED BLUE LIGHT-BLUE PINK YELLOW >> LIGHT-GREEN DARK-RED DARK-GREEN DARK-YELLOW DARK-BLUE >> PURPLE TURQUOISE LIGHT-GREY GREY >> > > Yeah, that's really cute! What does ATTRIBUTE do? It probably sets the console foreground text color, or perhaps the text background color instead, but most likely the foreground. Obviously, I'm not sure where those are defined in a Forth environment, or if they are normally, i.e., therefore the need for the Forth word COLORS. FYI, I can tell you where the C functions are located in case you need to consult them or use them: For DOS C, some C compilers have pre-defined arrays for the foreground and/or background colors. If they're defined, they're DOS functions, i.e., #include . Consult your compiler's documentation for more info on the functions. For Linux C, there is no pre-defined array of colors for foreground or background text. The colors are set via pdcurses functions, i.e., #include and 'gcc -lcurses'. Type 'man ncurses" in a console for the man page. Linux is a bit more complicated than DOS. For DOS, you can set the foreground or background text color independently of the other. With curses, you must set both at once. That's fine for text, if the program was designed that way. It's not so good for colored text images or ASCII art. Rod Pemberton