Forum Discussion
KevinO_Boyle
8 years agoQrew Cadet
I had a smart friend named Avi who gave me this code. It might be what you're looking for.
//Color Palette
var text grey = "#5D6D7E";
var text red = "#CB4335";
var text green = "#27AE60";
var text orange = "#F39C12";
var text blue = "#1F618D";
var text black = "#000000";
var text txtcolor = "#ffffff";
var text bgcolor = Case(true,
ToDate([Date Created]) = Today(),$blue,
ToDays(Today() - ToDate([Date Created]))<5, $green,
ToDays(Today() - ToDate([Date Created]))<7, $grey,
$orange
);
var text styleTextPartA = "style=\"text-decoration: none; text-align: center; background:" ;
var text styleTextPartB = "; white-space: nowrap; border-radius: 3px; padding-left: 4px; padding-right: 4px; padding-top: 3px; padding-bottom: 3px; color: white; font: normal 700 24px/1 \"Calibri\", sans-serif; display: inline-block; text-shadow: none" ;
var text style = $styleTextPartA & $bgcolor & $styleTextPartB ;
//Use the commented code below if you want the colorization only to be for the text and not the entire table cell
//"<a " & $style & ">" &ToText(ToDate([Date Created])) &"</a>"
"<div "& $style &">" & ToText(ToDate([Date Created])) & "</div>
//Color Palette
var text grey = "#5D6D7E";
var text red = "#CB4335";
var text green = "#27AE60";
var text orange = "#F39C12";
var text blue = "#1F618D";
var text black = "#000000";
var text txtcolor = "#ffffff";
var text bgcolor = Case(true,
ToDate([Date Created]) = Today(),$blue,
ToDays(Today() - ToDate([Date Created]))<5, $green,
ToDays(Today() - ToDate([Date Created]))<7, $grey,
$orange
);
var text styleTextPartA = "style=\"text-decoration: none; text-align: center; background:" ;
var text styleTextPartB = "; white-space: nowrap; border-radius: 3px; padding-left: 4px; padding-right: 4px; padding-top: 3px; padding-bottom: 3px; color: white; font: normal 700 24px/1 \"Calibri\", sans-serif; display: inline-block; text-shadow: none" ;
var text style = $styleTextPartA & $bgcolor & $styleTextPartB ;
//Use the commented code below if you want the colorization only to be for the text and not the entire table cell
//"<a " & $style & ">" &ToText(ToDate([Date Created])) &"</a>"
"<div "& $style &">" & ToText(ToDate([Date Created])) & "</div>