Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-28 10:56:50



Reply to topic  [ 6 posts ] 
LSL (Script) Editor colors - a dark option. 
Author Message

Joined: 2013-01-20 04:44:04
Posts: 12
Reply with quote
How To Change Script Editor Panel Colors To Colored Text On Dark Background.
By Kitto Flora Jan 11, 2017.
(CoolVL viewer only! Other viewers use different files and systems!)

NOTE: These changes were made to CoolVLViewer-1.26.20 on a 64-bit linux system.
If you want to make these changes on a different version you may find files
in different places.

I spend more than half my time in VR editing scripts, but I cannot stand
looking at the tiny text on that bright background for long. It gives me
'aura migraine' which is quite unpleasant. So here is a way to change the
display to have a dark background with light-colored text.

WARNINGS!
1) Part of this change requires changing a value in the source code
and re-compiling. You must be capable of doing that.
2) It also changes the Group Messages pop-up to white text on light-colored
background making it almost unreadable, but you can go read the message
in the Groups Panel, where it will be white on gray. I have been unable
to trace what sets the Group Messages pop-up background color, it is buried
somewhere in the source. If anyone can find it please let us know.
3) It changes the Note Card display to white on gray - but that is actually good.

Step 1. Change 'functions' color to light red:

Edit the source file ...linden/indra/newview/llpreviewscript.cpp
Search for the string "mEditor->loadKeywords"
Just above that you will see
LLColor3 color(....);
Change that line to
LLColor3 color(0.99f, 0.1f, 0.1f);
What's going on here is that the code changes the color of keywords set
in other files to the colors set in those files, but LSL functions are
not listed any place else so they get this 'default' value.
Recompile the code.
All other color changes are in 'text' files that are read each time
CoolVL is started.

Step 2. Change background, cursor etc. colors:

Change to the skins/ directory that you will be using.
(If you run CoolVL out of an installed directory it is likely at
~/CoolVLViewer-1.26.20/skins/
If you run out of the compiled directory it is likely at
.../linden/indra/viewer-linux-x86_64-release/newview/CoolVLViewer-x86_64-1.26.20.2/skins/

Edit file:
skins/default/colors_base.xml
(The values you will be changing are usually only in the default/colors_base.xml file,
but if you are using one of the other two skins and you have added the changed
value settings there, edit them there.)
The values to be changed are in the <!-- TEXTFIELDS --> section.
Change these listed values to the following:

<TextBgFocusColor value="5, 5, 5, 255" /> <!-- Text field background when receiving input (focused) -->
<TextBgReadOnlyColor value="100, 100, 100, 160" /> <!-- Text field background when read-only -->
<TextBgWriteableColor value="50, 50, 50, 230" /> <!-- Text field background when not receiving input (unfocused) -->
<TextCursorColor value="255, 255, 0, 255" />
<TextFgColor value="255, 255, 255, 255" />
<TextFgReadOnlyColor value="200, 200, 200, 200" />
<TextFgTentativeColor value="180, 180, 180, 180" />
<TextEmbeddedItemColor value="0, 0, 200, 255" />
<TextDefaultColor value="255, 255, 255, 255"/> <!-- Also script def. color i.e. variables, values, functions -->

Save the file.

Step 3. Change keyword colors:

In the skins/ directory selected as in Step 2
cd ../app_settings/
Edit file:
keywords.ini
In this file the colors of the various keywords is defined in the
[word <r>, <g>, <b>] (etc.) statement after each # <heading>.
Allowed values are 0 to .99

Change the following:

# sections
[word .2, .2, .99]

# data types
[word .3, .99, .3]

# events
[word 0, .6, .99]

# integer constants
[word .2, .2, .99]

# string constants
[word .2, .6, .99]

# float constants
[word .8, .4, .99]

# compound constants
[word .4, .4, .99]

# flow control keywords
[word .5, .5, .99]

# flow control label
[line .5, .5, .99]

# Comment
[one_sided_delimiter .99, .6, .3]

# Comment
[two_sided_delimiter .99, .6, .3]

# String literals
[two_sided_delimiter .2, .99, .2]

Save the file.

Thats it! Restart CoolVL and enjoy.

Kitto Flora.


2017-01-12 00:15:17
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
KittoFlora wrote:
WARNINGS!
1) Part of this change requires changing a value in the source code and re-compiling. You must be capable of doing that.
Yeah, LL didn't make custom skinning easy enough: there are still some hard-coded colors... But see below for good news.

Quote:
2) It also changes the Group Messages pop-up to white text on light-colored background making it almost unreadable, but you can go read the message in the Groups Panel, where it will be white on gray. I have been unable to trace what sets the Group Messages pop-up background color, it is buried somewhere in the source. If anyone can find it please let us know.
You just need to change GroupNotifyBoxColor in colors_base.xml (example in the default skin, be aware that other skins being just overrides to the default one, their colors_base.xml may not hold all the existing settings).

Quote:
3) It changes the Note Card display to white on gray - but that is actually good.
It will actually change all text editors background color...

Quote:
Step 1. Change 'functions' color to light red:
Edit the source file ...linden/indra/newview/llpreviewscript.cpp
.../...
What's going on here is that the code changes the color of keywords set in other files to the colors set in those files, but LSL functions are not listed any place else so they get this 'default' value.
Recompile the code.
Good news: for the next release, I made this setting configurable from colors_base.xml (new "LslFunctionTextFgColor" color setting). You will not need to recompile the viewer any more for such a change.

Quote:
Change to the skins/ directory that you will be using.
(If you run CoolVL out of an installed directory it is likely at ~/CoolVLViewer-1.26.20/skins/
Another piece of good news: I added the possibility, for next release, to define a "custom" skin. All you will have to do is creating a new "custom" directory in the Cool VL Viewer installation "skins" directory, and then to create at least a custom/colors_base.xml file (or copy the one from the default skin in custom/). Then you will be able to customize your skin (the customizations will override the default skin, so if you want, you may instead copy the overrides of the two other skins (sliver, dark) into custom/ and elaborate your customizations from them). Since the installer never removes files/folders that it does not know about, you will not have to worry about getting your custom skin overwritten/deleted during an update. I also added the possibility to select the custom skin (when it exists) from the Preferences panel, Skins tab.

Quote:
Step 3. Change keyword colors:
That's another aspect of the "hardcoding" (even if not in code itself, at least in "static" configuration files that get overwritten at each update). I also fixed this issue for next release, and instead of hardcoding the colors in keywords.ini, I replaced the said colors triplets with a string corresponding to a color defined in colors_base.xml. So, starting with next release, all you will have to do is to customize the added "Lsl*FgColor" settings in colors_base.xml, and keywords.ini can be left untouched.


2017-01-12 13:08:12
Profile WWW

Joined: 2013-01-20 04:44:04
Posts: 12
Reply with quote
That is good news about the next update exposing more color settings :D

GroupNotifyBoxColor sets the color of the outer part of the group notify box - default is a light blue.
What we need to change is the text area background color. It is color <218.238.255> and I have so far been unable to find such a setting in the source.


2017-01-12 20:59:18
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
It's 'LLColor4 semi_transparent' in llgroupnotify.cpp... I'll add a setting (GroupNotifyTextBgColor) in colors_base.xml for this one as well...


2017-01-12 22:29:44
Profile WWW

Joined: 2016-11-29 13:50:37
Posts: 17
Reply with quote
An example dark skin based on Gemini / Classic mashed together for people who want to experiment: *here*
Unzip it in the "skins" folder to give you a new "custom" folder.


2017-02-08 04:12:52
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Mogsington wrote:
An example dark skin based on Gemini / Classic mashed together for people who want to experiment: *here*
Unzip it in the "skins" folder to give you a new "custom" folder.
You should not any more change the colors inside keywords.ini: they are now pointers to colors defined in colors_base.xml (Lsl*Color entries). To convert the old color triplets in keywords.ini into the quadruplets adequate for use in colors_base.xml, simply multiply each float by 255 and round it to the closest integer, and keep 255 as the last element in the target quadruplet (meaning no transparency).


2017-02-08 08:57:50
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.