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
For now you'll need a small script to convert the color string (e.g. hex) to an actual color. I have some plans to automate that in a next version but that isn't working yet. Add a new C# script and copy the code from below.

The rest is simple: add your spreadsheet to the theme, go to your label and find the Overrides category, then find the Override Background Color property. Choose your spreadsheet column that has the hex color as your data binding. Then choose the script as the converter script.

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

namespace Scripts
{
public class StringToColorConverter : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var colorString = value?.ToString();
if (string.IsNullOrWhiteSpace(colorString))
return Colors.Transparent;

return (Color)ColorConverter.ConvertFromString(colorString);
}
}
}