How do twelve-character color codes work?

2

Possible Duplicate:
48-bit colours?

I'm using the Xfce 4.10 desktop environment on Ubuntu 12.04. While trying to get things the way I want I came across #aaaaaaaaaaaa and #666666666666 in ~/.config/Terminal/terminalrc.

[Configuration]

ColorForeground=#aaaaaaaaaaaa

lines deleted ...

ColorCursor=#666666666666

FontName=Monospace 11

Looking elsewhere, for example, I see more complex codes like the ones in bold below:

! Active border colors

Mwm*activeBackground: #9851785167AD

Mwm*activeTopShadowColor: #AF4199C18E2E

Mwm*activeBottomShadowColor: #529737652849

I know about the 6-character hex code and the RGB code from here but I hope someone here can explain the basis of these twelve-character color codes or point me to some easy reading on it?

user151227

Posted 2012-08-20T12:38:35.410

Reputation:

Question was closed 2012-08-20T13:49:27.993

Answers

4

The Xlib documentation, section "Color strings", mentions this. It seems that Xlib actually uses 16 bit RGB values (CSS is limited to 8 bits, and just happens to use a similar syntax).

RGB Device String Specification

[...] an older syntax for RGB Device is supported, but its continued use is not encouraged. The syntax is an initial sharp sign character followed by a numeric specification, in one of the following formats:

#RGB          (4 bits each)
#RRGGBB       (8 bits each)
#RRRGGGBBB    (12 bits each)
#RRRRGGGGBBBB (16 bits each)

The R, G, and B represent single hexadecimal digits. When fewer than 16 bits each are specified, they represent the most significant bits of the value (unlike the “rgb:” syntax, in which values are scaled). For example, the string “#3a7” is the same as “#3000a0007000”.

user1686

Posted 2012-08-20T12:38:35.410

Reputation: 283 655