User controlled theme colours.

19Jul08

Theme colours are a touchy area. Some artists like the theme set to a specific way, and some users want to customise their look. While the heated battle rages on, there are some things we can do in Edje that allows for both. In GTK, you have engines and themerc files that alter the way that engine runs. In Edje, we have color_classes.

Now, these colour classes were built to readily change the colour of fonts, but they basically feed a ‘color:’ value to whatever is using it. With this in mind, we can apply this to images. By default, an image will be displayed with ‘255 255 255 255’ colour. That means it will be full white and full alpha. When we start playing with the R G B values, different colours emerge. Heres an example.

Since this theme uses some basic color_class settings, the background here can be restyled via the ‘enlightenment_remote’ command line program. Heres an example of that.

Now you might be wondering, what about that last value? Do you need to keep alpha at 255? Thats the fun part. Most (if not all) areas in E17 can actually do transparency. This is a really neat feature, in that real transparency can be applied directly to the theme. Simply change the color_class value to 255 255 255 128, and you will have a non-coloured, transparent background. Now of course, you cant just go making everything transparent and not pay for it. You WILL need a composite manger, and you will need to turn on ‘enlightenment_remote -use-composite-set 1’ to enable the nice transparency. A little warning tho, E17 borders will do all sorts of graphical errors when they’re set to shaped, with a composite manager. This is mainly due to xcompmgr not working correctly.

I leave you with this neat little display of transparency, and a challenge to give the user some control in your theme.

Enjoy!
Toma

Note: Find out more about color_classes here.
Also, dont forget you can have a color_class with just 1 color: value!

Advertisements


No Responses Yet to “User controlled theme colours.”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: