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 Josh L
on
Use the "override background color" option on whatever widgets/subwidgets/labels you want the color to be on. For the data binding, select the column of the spreadsheet where the color codes are. Add this script to your theme and select it as a converter script on the override background color:

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

namespace Scripts
{
public class HexConvert : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var colorString = value?.ToString();
if (string.IsNullOrWhiteSpace(colorString))
return Color.FromRgb(153,0,0);

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


That will convert the hex code in the spreadsheet to a background color.