Wrox Programmer Forums
|
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2003, 11:22 AM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to OzzyUltra Send a message via MSN to OzzyUltra
Default Font Color

HI,

People i have a little problem with programming on Linux. Right now I am using Kate on Linux for performing my programming needs. I need a to change the color of the font which appears on the standard output. I can't seem to find the header library associated with this particualr function. Please help me out.

its really appreciated:)
Ozzy

 
Old October 22nd, 2004, 10:01 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

you can use \033[ <colour_number> m without the spaces eg:
echo -e "\033[42mThis is green\033[0m"

I knocked up a bit of perl to illustrate:

#!/usr/bin/perl

for (30..37,40..47) {
        print "\n" if ($_%10==0);
        print "\033[$_" . "m $_ \033[0m";
}
print "\n";

--
Don't Stand on your head - you'll get footprints in your hair. http://charlieharvey.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
not enable textbox or combobox font color SabinoFonseca VB.NET 2002/2003 Basics 1 March 15th, 2007 01:52 PM
Cell/Font Color in DataGrid. su C# 1 December 3rd, 2006 04:58 AM
how to get font ,color,font size of text in win32 satishsatao Visual C++ 0 April 5th, 2006 05:05 AM
change font color of label red pritz BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 November 14th, 2005 03:48 AM
font color, what different possibilites are phpsharma HTML Code Clinic 2 November 12th, 2003 06:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.