Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to convert the mac4lin awn theme from 0.3 to 0.4 so it will work in my awn. But I'm not sure about the colour codes in the 0.4 files. They are not normal hex codes, they are sixteen digits and look like this:

ghistep1 = #f2f2caca00001212
ghistep2 = #f2f2caca00001212

The ones in the 0.3 look like this:

glass_histep_2 = FFFFFF00
glass_histep_1 = FFFFFF2C

How do I convert the colour codes? What are they?

share|improve this question
up vote 1 down vote accepted

As long as the gamma is the same, you can take each 8-bit part of the 32-bit color code, and handle it as unsigned in the range 0 to 255. Multiply it by 257 (not 256) (or add it to itself shifted left by 8 bit positions). This gives you values in the range 0 to 65535 in intervals of 257. That should look the same complete with 8-bit like contouring. The alpha channel MAY need different processing. Then reconstruct it as the 64-bit color code. How you do this depends on your programming language.

share|improve this answer

They're 64-bit RGBA codes in the form RRRRGGGGBBBBAAAA. Simply scale the smaller colors to fit. Although the smaller colors may work once they're completed.

share|improve this answer
thanks, but how do i simply scale the smaller colors to fit? – gadgetmo Dec 30 '11 at 17:15
Do you take the first 2 digits? The last 2? take RRRR/FF?(this is the one I would try first, btw) – Kevin M Dec 30 '11 at 18:07
@KevinM I don't know about Mac4lin themes specifically, but usually the color RRGGBBAA would expand to RR00GG00BB00AA00 (fraction of 0x10000 instead of 0x100). – Gilles Dec 30 '11 at 22:04
@gadgetmo: take the first two hex digits as they are the most significant digits. Think about a scoring system where people score from 0 to 100 and how you would convert that to a score from 0 to 10. Apply the same technique. – camh Dec 30 '11 at 22:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.