Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
There are several easy ways but the core is the "Override Font Color" property of any label. This allows you to data-bind the font color. You can use a Spreadsheet item where a column contains the desired color (hex code for example), and bind the Override Font Color to that column. Or you can use a column that simply says "1" or "true" or something to indicate that this driver is a playoff driver, and put the color in the converter script.

In each case, you need to also specify a converter script. Even if you put the color hex code in the spreadsheet, the data binding unfortunately does not understand that it represents a color so you still have to convert it to a color with a script. That script is very simple and can just take a string as input (e.g hex color, or even names like "Red") and convert it with ColorConverter:

using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using System.Windows.Media;

namespace Scripts
{
public class ConvertToColor : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
return null;

var colorString = value.ToString();
return (Color)ColorConverter.ConvertFromString(colorString);
}
}
}