Skip to content

Instantly share code, notes, and snippets.

@thechriskent
Last active December 11, 2017 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thechriskent/5bd82b5d7b4db308f15eefb252fd9d96 to your computer and use it in GitHub Desktop.
Save thechriskent/5bd82b5d7b4db308f15eefb252fd9d96 to your computer and use it in GitHub Desktop.
Quick sample of applying customized colors
{
"$schema": "https://gist.githubusercontent.com/thechriskent/2e09be14a4b491cfae256220cfca6310/raw/eb9f675bf523208eb840c462d4f716fa92ce14c2/columnFormattingSchema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value1"
]
},
"lime",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value2"
]
},
"yellow",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value3"
]
},
"red",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value4"
]
},
"blue",
"fuschia"
]
}
]
}
]
}
]
},
"background-color": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value1"
]
},
"yellow",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value2"
]
},
"purple",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value3"
]
},
"black",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Value4"
]
},
"grey",
"brown"
]
}
]
}
]
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment