Home » excel » c# – What color code is this?

c# – What color code is this?

Posted by: admin April 23, 2020 Leave a comment

Questions:

I’m looking at a code snippet which places text in an excel header:

headerText.Append(@"&""Calibri""&20&K04-024HEADER-TEXT");

&""Calibri"" modifies the font, &20 modifies the size, and &K04-024 modifies the color (to navyish).

The question is, what kind of color code is this (K04-024)? I’ve seen various types before but nothing like this. I’ve tried scouring google and can’t find anything about it.

EDIT:

This is C# using Spreadsheet Gear to drop text into an Excel header. It turns out that: &K01+047 is a medium grey color. These numbers were figured out by examining an XML excel document and seeing what excel uses internally as colors.

EDIT:
For the RGB Scale:

K04-024 translates to R:045 G:107 B:181

K01+047 translates to R:120 G:120 B:120

How to&Answers:

It looks like it’s RGB with dash meaning an empty color, as 0x040024/R4 G0 B36 gives a navy color.

Edit in response to your edit:
It looks like they’re combined colors from a palette. See here for the list of colors and indices.