Syntax Highlighting Color references\chart

Syntax highlighting, code folding, brace matching, code indenting, and function list

Syntax Highlighting Color references\chart

Postby dbdbdb » Thu Apr 16, 2009 10:55 pm

Hello all,

What is the color format or chart referenced in wordfiles?

Goal = I'm looking to modify the colors specified in a wordfile to match another application.

example: Colors = 8421504

Thanks
dbdbdb
Newbie
 
Posts: 2
Joined: Thu Apr 16, 2009 10:45 pm

Re: Syntax Highlighting Color references\chart

Postby Mofi » Fri Apr 17, 2009 2:51 am

RGB value in decimal. Decimal 8421504 = hexadecimal 808080 = RED hex. 80, GREEN hex. 80, BLUE hex. 80 = RED dec. 128, GREEN = dec. 128, BLUE dec. 128
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Syntax Highlighting Color references\chart

Postby rhapdog » Fri Apr 17, 2009 6:13 am

I think it's important to note, that while decimal 84215404 = hexadecimal 808080 and Mofi is technically right about the red, green, and blue hex values above, UltraEdit syntax colors do not use the standard hex order RGB, but instead a reverse order of BGR (at least when compared to the hex order in HTML files.)

For example, a decimal number in a wordfile 54509 = hexadecimal 00D4ED, which will translate to RED hex ED, GREEN hex D4, and BLUE hex 00. This would be RED = dec. 237, GREEN = dec. 212, and BLUE = dec. 0.

I hope this makes it more clear.
User avatar
rhapdog
Master
Master
 
Posts: 265
Joined: Tue Apr 01, 2008 10:02 am
Location: Mississippi, USA

Re: Syntax Highlighting Color references\chart

Postby Mofi » Fri Apr 17, 2009 6:36 am

Thanks, rhapdog. The example in my answer was not really good.

The order is BGR because that is the byte order used by the RGB macro of Visual C++ which produces the 32 bit unsigned color value.

In C/C++ the macro does something like that

DWORD COLORREF = ((DWORD)BLUE << 16) | ((DWORD)GREEN << 8) | (DWORD)RED;

or better readable for non programmers:

Color = BLUE * 65536 + GREEN * 256 + RED

As a C/C++ programmer I automatically read the bytes from right to left to get the RGB values. And when I'm working with HTML and CSS I automatically read the RGB values from left to right. Thanks again rhapdog to make it clear for all non C/C++ programmers and HTML writers.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Syntax Highlighting Color references\chart

Postby dbdbdb » Fri Apr 17, 2009 10:10 am

Many thanks rhapdog & mofi.

The first response had me searching the hex\dec charts without success. The second response really cleared up the confusion.

Thanks Again.
dbdbdb
Newbie
 
Posts: 2
Joined: Thu Apr 16, 2009 10:45 pm


Return to Syntax Highlighting