Tunable GTK RGBA module

Various Gnome Stuff

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 47%
Description:

This differs from the GTK RGBA module currently on here as it is a function, not a boolean.

charleswight

8 years ago

http://www.linuxquestions.org/questions/general-10/a-binary-alpha-release-of-my-kernel-now-with-full-source-762850/page40.html#post4021086

http://www.linuxquestions.org/questions/programming-9/gcc-compilation-error-817542/

Moderator/Admin/Whomever ... please remove this silliness that folks don't unknowingly waste their time.

Report

charleswight

8 years ago

I'm not sure that this code does anything!

Report

ubuntico

8 years ago

Someone can say if this module works really?
And a "how to" could be helpful too.

Thanks.

Report

C

KennyStrawn

8 years ago

For those of you who need help finding out what integers or decimals go into the color or Alpha places, listen up:

The color values (Red, Green, or Blue) can have values from 0 to 255.

The alpha value is a decimal between 0 and 1, 1 being opaque and 0 being completely transparent.

An example of the color of Ubuntu 10.04's progress bars with 60% transparency, for example:

rgba(241, 93, 44, 0.6);

For solid red with 60% transparency:

rgba(255, 0, 0, 0.6);

For solid blue with 60% transparency:

rgba(0, 0, 255, 0.6);

For solid green with 60% transparency:

rgba(0, 255, 0, 0.6);

For cyan with 60% transparency:

rgba(0, 255, 255, 0.6);

For magenta with 60% transparency:

rgba(255, 0, 255, 0.6);

For yellow with 60% transparency:

rgba(255, 255, 0, 0.6);

For black with 60% transparency:

rgba(0, 0, 0, 0.6);

For white with 60% transparency:

rgba(255, 255, 255, 0.6);

And the list goes on. And yes, Alpha can accept more than one decimal place for more precise color customization.

This can be used in themes more than anything else to RGBA individual parts of it as mentioned previously.

Report

ubuntico

8 years ago

For example, If I want a part of the gtk theme black with a 60%, this is correct?

engine "murrine" {
rgba = (0, 0, 0, 0.6)
}

Report

juandejesuss

8 years ago

The idea sounds so great, but I still having many questions, I'm new on this...

can I use this on a gtk-theme?? if yes, could you put an example???
do I need murrine engine to make this work?

which path should I put this code??

----------------------------------------
#include <glib.h>
#include <glib/gtypes.h>
#include <gtk/gtk.h>

void rgbamap(unsigned long Red, unsigned long Green, unsigned long Blue, float Alpha) {

unsigned long rgbCube = Red * Green * Blue;

double aRed = Alpha*(Red);
double aGreen = Alpha*(Green);
double aBlue = Alpha*(Blue);

double rBlend = (1 - Alpha)*Red + Alpha*(aRed);
double gBlend = (1 - Alpha)*Green + Alpha*(aGreen);
double bBlend = (1 - Alpha)*Blue + Alpha*(aBlue);
};
----------------------------------------


thanks in advance for your time =D

Report

C

KennyStrawn

8 years ago

The code has been edited and reposted, but you would compile it using the following command:

gcc -fPIC -shared librgbamap.c -o librgbamap.so `pkg-config --cflags --libs gtk+-2.0`

and then copy it to /usr/lib/gtk-2.0/modules.

Or, if you don't want to touch the terminal, download the precompiled binary (also here) and again copy it to /usr/lib/gtk-2.0/modules.

Report

C

KennyStrawn

8 years ago

Just so you're wondering, the current RGBA module just has two options: true and false.

This is a whole RGBA color map. It allows you to change the color of and make transparent individual elements of a theme, such as the window borders, while leaving everything else opaque. It also allows you to change colors of specific items using more than just HTML notations. Makes sense now? It can be used to RGBA parts of a theme, not just the whole theme or nothing. Also: You can tell the module how transparent or opaque you want the transparency to be.

Report

VCoolio

8 years ago

Hi, looks interesting, but I don't understand yet how to use it and where. Does it replace the need for modifying the murrine source, and do I put your lines in .profile, or is it able to configure different transparancy levels for different widgets in gtkrc?

Report

C

KennyStrawn

8 years ago

The difference between librgba and librgba-tunable goes as follows:

Librgba only has two options: true and false.

Librgba-tunable has many options:

[code]int rgba(int, int, int, int);[/code]

Essentially, this module is a function that defines a whole RGBA color map, allowing you to set how transparent or opaque your color map is, plus set what colors you can have in it, just like GNOME Shell's RGBA function, only in GTK, not the Shell.

Report

product-maker 11 9

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.0
updated Jul 02 2010
added Jun 23 2010
downloads today
0
page views today 1