You are not logged in.

#1 2008-03-08 22:14:16

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Xdefaults urxvt color

The xdefaults part for urxvt color has always confused me. Using rgba,  I would assume it to have 3 digits like rrr/ggg/bbb/aaa not four. So where does the fourth come from? I'm trying to make a light brown and guessing isn't getting me must past normal brown. An example:

urxvt.background:  rgba:7860/6830/5600/eeee
urxvt.foreground: rgba:3860/3030/2500/ffff

Offline

#2 2008-03-08 22:39:49

BC
Member
Registered: 2008-01-29
Posts: 83

Re: Xdefaults urxvt color

You could always use hex, 2 digits per color like:

URxvt*background: #000000
URxvt*foreground: #b2b2b2

Offline

#3 2008-03-08 22:49:08

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: Xdefaults urxvt color

I've done that in the past, but that takes out the alpha channel and I prefer a smidge of transparency.

Offline

#4 2008-03-08 23:00:45

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: Xdefaults urxvt color

While I'd still like to know, I just did it the way above and gave compiz a rule for it.

Offline

#5 2008-03-08 23:43:41

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Xdefaults urxvt color

This very question has plagued me for some months now.  I've played with a number of variations and I can't figure out how to take a hex value and convert it to urxvt's rgba format.  If anyone could post some insight I would be eternally grateful.


thayer williams ~ cinderwick.ca

Offline

#6 2008-03-09 03:49:52

BC
Member
Registered: 2008-01-29
Posts: 83

Re: Xdefaults urxvt color

I might be misunderstanding you thayer, but this works for me:

URxvt*background: [50]#000000

For a half-transparent black background.  I know it's not the r/g/b/a format, but it works.

Offline

#7 2008-03-09 06:08:28

semdornus
Member
From: Tokyo
Registered: 2007-08-07
Posts: 47

Re: Xdefaults urxvt color

I took a quick look at the source and urxvt (and Xft) use the low-level XRenderColor struct from X11 to specify colors, which has four digits per channel (each an unsigned short).
This is, as I understand it, the 48-bit RGB color model (16 bits per channel) which makes 48, plus of course the alpha channel for a total of the 64-bit rgba.
But I'm not much of an expert in this field.

Offline

#8 2008-03-09 18:39:48

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Xdefaults urxvt color

Thanks BC, that is helpful too, but what I'd like to know is how to take a hex colour, say #817859 and convert that to rgba format of 0000/0000/0000/ffff.


thayer williams ~ cinderwick.ca

Offline

#9 2008-03-11 11:53:31

semdornus
Member
From: Tokyo
Registered: 2007-08-07
Posts: 47

Re: Xdefaults urxvt color

thayer wrote:

Thanks BC, that is helpful too, but what I'd like to know is how to take a hex colour, say #817859 and convert that to rgba format of 0000/0000/0000/ffff.

You just add zeroes and don't use the alpha channel: rgba:8100/7800/5900/ffff

Offline

#10 2009-06-11 11:38:14

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Xdefaults urxvt color

Sorry to revive such an old thread, but I'm having problems figuring rgba out as well.

I want to create a slightly transparent light background with urxvt and .Xdefault using rgba, but it is really hard to find some proper documentation on this subject. Anyone knows how and can explain it to me?

I'm currently using: rgba:ff00/ff00/ff00/ff00

Which gives me a solid white background.

Last edited by Ashren (2009-06-11 11:52:27)

Offline

#11 2009-06-11 12:26:22

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: Xdefaults urxvt color

Depends on what color bit depth you set (24 or 32). why use the color's rgba and not urxvt's own shading capabilities? (you'll get fake transparencies though...)

URxvt.transparent: true
URxvt.shading: 50
URxvt.inheritPixmap: true

Should be enough for a 50% semi-opaque urxvt (fake transparency)


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#12 2009-06-11 16:20:46

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Xdefaults urxvt color

I have no specific reason for using real transparency, since I'm not moving windows around. Basically I just wanted to figure out how rgba works.

To get a light (white) background with transparency I'm currently using "rgba:00ff/00ff/00ff/ff00 which works, but I don't know how to grade it properly. I understand that the four channels listed stands for red,green,blue and alpha. The alpha channel is what makes things transparent, but I don't really get why there are four digits in each channel.

Offline

#13 2022-01-19 07:07:29

aveboss
Member
Registered: 2022-01-19
Posts: 1

Re: Xdefaults urxvt color

I know I'm replying to a very, very old post, but I was also looking for an answer. Like @semdornus stated, you just take the hex value and add two zeros. Same applies for the alpha channel. If you want 50% transparency, it is 128 as decimal, and 0x80 as hex. So the value would be 8000. Usually the hex values are specified as #AARRGGBB. To convert it to the rgba format, it will be RR00/GG00/BB00/AA00. I don't know the reason for it, but that's what I found when I tested it.

Offline

#14 2022-01-19 08:20:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,431

Re: Xdefaults urxvt color

Please don't do that, while you at least had a topical contribution I really hope they aren't looking for an answer 13 years later.

https://wiki.archlinux.org/title/Genera … bumping%22

Closing.

Offline

Board footer

Powered by FluxBB