public override void initializeWidget() { base.initializeWidget(); label = cave.ui.LabelWidget.forText(context, labeltext); var color = textColor; if (color == null) { if (backgroundColor.isLightColor()) { color = cave.Color.forRGB(0, 0, 0); } else { color = cave.Color.forRGB(255, 255, 255); } } label.setWidgetTextColor(color); addWidget((Windows.UI.Xaml.UIElement)cave.ui.CanvasWidget.forColor(context, backgroundColor)); addWidget((Windows.UI.Xaml.UIElement)cave.ui.LayerWidget.forWidget(context, (Windows.UI.Xaml.UIElement)label, context.getHeightValue("1500um"))); }
private void updateWidgetColors() { var textColor = widgetTextColor; if (!(textColor != null)) { if (widgetBackgroundColor != null) { if (widgetBackgroundColor.isLightColor()) { textColor = cave.Color.black(); } else { textColor = cave.Color.white(); } } else { textColor = cave.Color.black(); } } }
public cave.Color getActualWidgetTextColor() { var textColor = widgetTextColor; if (textColor == null) { if (widgetBackgroundColor != null) { if (widgetBackgroundColor.isLightColor()) { textColor = cave.Color.black(); } else { textColor = cave.Color.white(); } } else { textColor = cave.Color.black(); } } return(textColor); }
private void updateWidgetColors() { var textColor = widgetTextColor; if (textColor == null) { if (widgetBackgroundColor != null) { if (widgetBackgroundColor.isLightColor()) { textColor = cave.Color.black(); } else { textColor = cave.Color.white(); } } else { textColor = cave.Color.black(); } } this.Foreground = textColor.toBrush(); }