rename opacity to opacity_percent for consistency (#2310)

This commit is contained in:
Jason Dove
2025-08-13 15:21:25 +00:00
committed by GitHub
parent c9e6e601c2
commit 558e2ce333
4 changed files with 6 additions and 4 deletions
@@ -8,7 +8,8 @@ public class ImageGraphicsElement
{
public string Image { get; set; }
public int? Opacity { get; set; }
[YamlMember(Alias = "opacity_percent", ApplyNamingConventions = false)]
public int? OpacityPercent { get; set; }
[YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)]
public string OpacityExpression { get; set; }
@@ -6,7 +6,8 @@ namespace ErsatzTV.Core.Graphics;
public class TextGraphicsElement
{
public int? Opacity { get; set; }
[YamlMember(Alias = "opacity_percent", ApplyNamingConventions = false)]
public int? OpacityPercent { get; set; }
[YamlMember(Alias = "opacity_expression", ApplyNamingConventions = false)]
public string OpacityExpression { get; set; }
@@ -40,7 +40,7 @@ public class ImageElement(ImageGraphicsElement imageGraphicsElement, ILogger log
}
else
{
_opacity = (imageGraphicsElement.Opacity ?? 100) / 100.0f;
_opacity = (imageGraphicsElement.OpacityPercent ?? 100) / 100.0f;
}
ZIndex = imageGraphicsElement.ZIndex ?? 0;
@@ -40,7 +40,7 @@ public class TextElement(TextGraphicsElement textElement, Dictionary<string, obj
}
else
{
_opacity = (textElement.Opacity ?? 100) / 100.0f;
_opacity = (textElement.OpacityPercent ?? 100) / 100.0f;
}
ZIndex = textElement.ZIndex ?? 0;