Configuration of color template

Modified on Mon, 5 Oct at 1:54 PM

In order to apply colors in the table, row, column and cell designs, we must configure a color template containing the needed colors.

The color template must be saved as a .json file and should simply contain a key with a value for each color. The .json file for colors should be located in following path:

...\OfficeExtensions\Content\SkabelonDesign.CorporateTables\colors

The key is where we define a name of the color, while the value is the color in RGB. We use the key in the table, row, column and cell templates in order to refer to a color. The color template can contain as many colors as needed.

Best practice is to name the keys in a meaningful way according to the purpose of the colors.

Here is an example:

Code
{
    "Text": "0, 0, 0",
    "Borders": "115, 115, 115",
    "Background": "0, 255, 255, 255"
}

We also support using alpha. This can be done for all color references in the configuration. If the alpha is 0, it will be fully transparent, while it will not be transparent at all if alpha is 255. Here are some examples:

"0,0,0,0" = Fully transparent
"255,0,0,0" = Not transparent at all black (this is the same as just writing "0,0,0")
"127,0,0,0" = 50% transparent black

How many color templates do I need?

As mentioned, a color template can contain as many colors as needed. Thus, we always recommend to have only one color template in a client's solution - even if the client has a table design including variants that apply banded rows or columns. In that case, the color for the banding should just be added to the color template as a key with a proper name.

Obviously, there are cases where it is necessary to have multiple color templates. For instance, a table design can have 10 variants, where the only difference is from the variants is the color theme. In such case, we create a color template for each variant in order to refer to the correct color theme.

Use accent colors

We also support referring to accent colors from the color theme that is set in the document, presentation or sheet. To do so, use bytes instead of RGB. The format in the json is "1, 1, 1, BYTESWITCH", and the BYTESWITCH can be any of the following values:

1 = Accent1

2 = Accent2

3 = Accent3

4 = Accent4

5 = Accent5

6 = Accent6

7 = Dark1

8 = Light1

9 = Dark2

10 = Light2

Here is an example:

Code
{
 "Primary":"1, 1, 1, 1",
 "Secondary":"1, 1, 1, 3",
 "Background":"1, 1, 1, 5",
 "NoFill":"1, 1, 1, 4"
}

When using accents, the colors of your table will automatically change when the color theme in your document or presentation changes.

In the specific example above, "Primary" uses Accent1, "Secondary" uses Accent3, "Highlight" uses Accent5, "Fill" uses Accent2 and "BandedGrey" uses Accent4.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article