Forum Discussion
Json colors other than the .mscolors
- May 08, 2019
BigBeuferd Depending on how/where you're trying to apply the color, you would need to add a "style" object after you declare an element in JSON.
Depending on what element you're applying the "style" object to, you can add in a "background-color" and/or "color" attribute to change the font/background colors. You can use RGB or HEX values for either of those attributes.
"style": {"background-color": "#f4f4f4"}One thing to watch out for is your commas; if you miss a comma, your JSON will be invalid. If you use https://code.visualstudio.com/, it validates as you go.
This article does a nice job of breaking down JSON structure for view formatting.
https://collab365.community/sharepoint-modern-view-formatting-json-part-1-2/
This might help you. I found this excellent list of SharePoint online classes for Modern UI created by https://sharepoint.stackexchange.com/users/7868/denis-molodtsovDenis Molodtsov
List of Reusable SharePoint Online Classes for Modern UI
https://zerg00s.github.io/sp-modern-classes/
I found this very helpful.