[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default colours in X11 frames?
From: |
James Cloos |
Subject: |
Re: Default colours in X11 frames? |
Date: |
Mon, 21 Jul 2008 16:13:54 -0400 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
>>>>> "David" == David Kastrup <address@hidden> writes:
David> Will you fix it in Emacs or in X?
In X.
David> If the latter: is there a workaround one could use in Emacs for
David> people having an unfixed X?
In theory. Were one to take rgb.txt (Emacs' copy will work) and convert
it into the format used by Xcms.txt (/usr/lib/X11/Xcms.txt on Gentoo,
probably the same on most other dists) then libX11 would find the colour
name when it searches that and wouldn't bother to ask the server.
Everthing before the line:
XCMS_COLORDB_START 0.1
is ignored. As is everything after the line:
XCMS_COLORDB_END
And rgb.txt line such as:
255 250 250 snow
could look like this in Xcms.txt:
cms snow rgb:255/250/250
Something like this perl script, which reads from either stdin or
its filename arguments and writes to stdout, should do it:
#!/usr/bin/perl
print "XCMS_COLORDB_START 0.1\n";
# print the colours from the default Xcms.txt
print "cms red\t\tCIEXYZ:0.3811/0.2073/0.0213\n";
print "cms green\t\tCIEXYZ:0.3203/0.6805/0.1430\n";
print "cms blue\t\tCIEXYZ:0.2483/0.1122/1.2417\n";
# then convert all of the rgb.txt colours
while (<>) {
next if /^#/;
next if /^$/;
chomp;
my @line=split;
print join(" ",@line[3..$#line]);
printf("\t\t\trgb:%x/%x/%x\n", $line[0], $line[1], $line[2]);
}
print "XCMS_COLORDB_END\n";
exit;
-JimC
--
James Cloos <address@hidden> OpenPGP: 1024D/ED7DAEA6