Quick question: Can I add custom colors to the View Formatting?

Copper Contributor

Edit: This is on Sharepoint Online using modern experience.

 

I have custom JSON in a list to color code the row based on one column. The only colors I have been able to make work are the colors from the Office UI Fabric. I want to make the colors a little more transparent. Here is my current code:

 

{
  "$schema": "<a href="https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json" target="_blank">https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json</a>",
   "additionalRowClass": "=if([$Status] == 'Status1', 'ms-bgColor-greenLight',
                           if([$Status] == 'Status2', 'ms-bgColor-neutralQuaternaryAlt', 
                           if([$Status] == 'Status3', 'ms-bgColor-red ms-fontColor-black, false)))"
}

 

 I tried adding the following before "additionalRowClass" ... and changing the Status1 if statement to 'greenLight', but that didn't work.

 

"greenLight": [16, 124, 16, 0.2],

 

I'm no pro in JSON, but I have read through all these Schemas and I can't find and reference or definition to colors what so ever.

 

Thank you for any help you can provide.

1 Reply

@Dave0673 

 

Take a look at this section of the column formatting documentation. It looks like you can add a "style" property where you can add properties like "color" or (presumably) "background-color"

 

https://docs.microsoft.com/en-gb/sharepoint/dev/declarative-customization/column-formatting#apply-fo...