Print Thread
What is the encoding used for exporting colour preferences?
#52705 12/14/15 10:24 AM
Joined: Sep 2003
Posts: 387
London, UK
Member
OP Offline
Member
Joined: Sep 2003
Posts: 387
London, UK
Exporting my colour settings gives a .ini file containing colours encoded as decimal numbers:

Code
[Colors]
GradientEnabled=True
VerticalGradient=False
DefaultGradient=False
GradientCol1=-16777213
GradientCol2=14858125
NullValueColor=15073279
AltRowColor=15073253
CompareColor=13421823
ErrorBkgCol=65535
ErrorTextCol=255
...
Is there a formula or link that explains how to convert between these and RGB? I'd like to be able to synchronise my colour scheme with external editors e.g. Vim, or if I have a colour scheme I'm proud of I'd like to be able to publish it in both Vim and PL/SQL Developer formats.

Re: What is the encoding used for exporting colour preferences?
William Robertson #52713 12/15/15 10:15 AM
Joined: Aug 1999
Posts: 22,200
Member
Offline
Member
Joined: Aug 1999
Posts: 22,200
It's a 24 bit integer number in decimal format. The 3 bytes are the RGB values from 0..255.


Marco Kalter
Allround Automations
Re: What is the encoding used for exporting colour preferences?
Marco Kalter #52746 12/16/15 12:19 PM
Joined: Sep 2003
Posts: 387
London, UK
Member
OP Offline
Member
Joined: Sep 2003
Posts: 387
London, UK
Thanks. I'm still struggling a bit though. e.g. GradientCol2=14858125, which is E2B78D in hex, but that's nothing like the actual colour which (from eyedropper sampling) is actually 8CB6E1 (140,182,225). And how do the negative numbers work?

Re: What is the encoding used for exporting colour preferences?
William Robertson #52749 12/16/15 03:39 PM
Joined: Jul 2004
Posts: 592
W
Member
Offline
Member
W
Joined: Jul 2004
Posts: 592
To get RGB you need to reverse the bytes.

14858125 is E2B78D which is B=E2, G=B7, R=8D, or RGB:8DB7E2.

I don't know about the negative numbers.

Re: What is the encoding used for exporting colour preferences?
Worker #52760 12/17/15 11:59 AM
Joined: Sep 2003
Posts: 387
London, UK
Member
OP Offline
Member
Joined: Sep 2003
Posts: 387
London, UK
Cool, so it is smile

I might have spotted that myself if my eyedropper tool hadn't given me #8CB6E1 instead of #8DB7E2 (1 digit lower for each value) from the PL/SQL Dev preferences page, even though it is accurate on colour picker websites. Maybe the preferences page displays everything one point darker? (Not that it makes a particularly visible difference.)

As an enhancement request for Marco's famous list, it would be nice to have a better color picker/theme organiser, ideally including the console itself and not just code windows, like the one in IntelliJ for example.

Re: What is the encoding used for exporting colour preferences?
Worker #52782 12/18/15 01:46 PM
Joined: Sep 2003
Posts: 387
London, UK
Member
OP Offline
Member
Joined: Sep 2003
Posts: 387
London, UK
OK, looks like the Excel formula to convert standard Hex RGB to PL/SQL Developer decimal is:

Code
=HEX2DEC(CONCATENATE(MID(G2,5,2), MID(G2,3,2), MID(G2,1,2)))
(where column G contains Hex RGB).

It's a pity PL/SQL Developer doesn't have more highlighting categories though. I've used 'Custom Keywords' for the PL/SQL named exceptions, but there's nothing for Types or Functions.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.046s Queries: 14 (0.011s) Memory: 2.5200 MB (Peak: 3.0398 MB) Data Comp: Off Server Time: 2024-04-21 11:40:53 UTC
Valid HTML 5 and Valid CSS