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
This will just display nothing if no color is found:

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);
}
}
}