Bug 133983 - Random hue per shell not per Konsole instance
Summary: Random hue per shell not per Konsole instance
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-12 21:42 UTC by Daniel Oliver
Modified: 2007-07-08 05:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Oliver 2006-09-12 21:42:09 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    SuSE RPMs

I'd like to use the random hue feature to clearly differentiate between shells, but only one hue is ever chosen per Konsole instance.

The hue is currently chosen and assigned in ColorSchema::rereadSchemaFile(). As far I could tell from my quick scan of the code, the fact a colour is random isn't passed beyond this function so some changes to ColorSchema would be required.

I'd like to submit a patch, but need to know if it's worth it first as I have no desire to check out KDE 4 if there are significant differences in schema.cpp and any other files I'm likely to need.
Comment 1 Robert Knight 2007-07-08 05:01:18 UTC
Implemented in KDE 4.  There is no GUI interface to control the randomness of colors yet, as I still have to think carefully about that.  This means that editing the color schemes manually is necessary to make use of this at present.

The way random color schemes are implemented is that for each slot in the terminal's color palette, a base color is specified.  There are then three additional optional properties which control how much that base color is allowed to be randomly adjusted for each terminal session which uses the color scheme - one for hue, one for saturation and one for value.  

eg.  From the supplied BlackOnRandomLight.colorscheme file:

[Background]
Bold=false
Color=247,247,214
Transparency=true
MaxRandomHue=340

(There are also MaxRandomSaturation and MaxRandomValue attributes which can be used.  The hue, saturation and value attributes have maximum values of 340,255 and 255 respectively)

Internally, each terminal display has a key which depends uniquely on the session it is displaying.  When the color table is updated for a particular display, the terminal display's key is used to seed the random number generator which is used to randomize the colors within the allowed range.