From owner-freebsd-questions Mon Sep 25 12:30:22 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA20072 for questions-outgoing; Mon, 25 Sep 1995 12:30:22 -0700 Received: from mail.barrnet.net (mail.barrnet.net [131.119.246.7]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA20067 for ; Mon, 25 Sep 1995 12:30:19 -0700 Received: from gilberto.physik.RWTH-Aachen.DE (gilberto.physik.rwth-aachen.de [137.226.31.2]) by mail.barrnet.net (8.6.10/MAIL-RELAY-LEN) with ESMTP id MAA01219 for ; Mon, 25 Sep 1995 12:30:14 -0700 Received: (from kuku@localhost) by gilberto.physik.RWTH-Aachen.DE (8.6.11/8.6.9) id UAA06649; Mon, 25 Sep 1995 20:21:15 +0100 Message-Id: <199509251921.UAA06649@gilberto.physik.RWTH-Aachen.DE> Subject: Re: Using color in C To: bemar@servicom.es (Antonio Navarro) Date: Mon, 25 Sep 1995 20:21:14 +0100 (MET) Cc: questions@freebsd.org In-Reply-To: <9509251840.AA12127@servicom.es> from "Antonio Navarro" at Sep 25, 95 06:42:29 pm From: Christoph Kukulies Reply-To: Christoph Kukulies X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 906 Sender: owner-questions@freebsd.org Precedence: bulk > > Hello ! > > I am trying to use colors under C. How can I show colors on the > screen (something similar to the COLOR statement in Basic) ?. I > have read the source code of the vidcontrol program (because > you can obtain 16 colors when you execute the vidcontrol > utility with the 'show' keyword), but I do not understand the > sequences to obtain color. > > Thanks in advance. You can alsway use ANSI escape sequences a la: #!/bin/sh in0="\033[0m" in1="\033[1m" sw0="\033[30m" rt0="\033[31m" gn0="\033[32m" gb0="\033[33m" bl0="\033[34m" mg0="\033[35m" cn0="\033[36m" ws0="\033[37m" sw1="\033[40m" rt1="\033[41m" gn1="\033[42m" gb1="\033[43m" bl1="\033[44m" mg1="\033[45m" cn1="\033[46m" ws1="\033[47m" printf "\033[H\033[J\033[41m$gn0\Free\033[42m$bl0\BSD$in0\n" > > Antonio Navarro > L'Eliana - Valencia (Spain) > > > --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de