Syntax Highlighting Color references\chart

Syntax Highlighting Color references\chart

2
NewbieNewbie
2

    Apr 17, 2009#1

    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

    6,683583
    Grand MasterGrand Master
    6,683583

      Apr 17, 2009#2

      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
      Best regards from an UC/UE/UES for Windows user from Austria

      2362
      MasterMaster
      2362

        Apr 17, 2009#3

        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.
        “Don’t document the problem, fix it.” – Atli Björgvin Oddsson

        6,683583
        Grand MasterGrand Master
        6,683583

          Apr 17, 2009#4

          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.
          Best regards from an UC/UE/UES for Windows user from Austria

          2
          NewbieNewbie
          2

            Apr 17, 2009#5

            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.