protected override IView OnConvertToView(FigmaNode currentNode, ViewNode parentNode, ViewRenderService rendererService) { var colorWell = new NSColorWell() { TranslatesAutoresizingMaskIntoConstraints = false }; var frame = (FigmaFrame)currentNode; FigmaVector rectangle = frame.children .OfType <FigmaVector>() .FirstOrDefault(s => s.name == ComponentString.VALUE); foreach (var styleMap in rectangle?.styles) { if (rendererService.NodeProvider.TryGetStyle(styleMap.Value, out FigmaStyle style)) { if (styleMap.Key == "fill") { colorWell.Color = ColorService.GetNSColor(style.name); } } } return(new View(colorWell)); }
void ReleaseDesignerOutlets() { if (colorWell != null) { colorWell.Dispose (); colorWell = null; } if (checkBox != null) { checkBox.Dispose (); checkBox = null; } }
protected override IView OnConvertToView(FigmaNode currentNode, ProcessedNode parentNode, FigmaRendererService rendererService) { var colorWell = new NSColorWell(); var frame = (FigmaFrame)currentNode; FigmaVectorEntity rectangle = frame.children .OfType <FigmaVectorEntity>() .FirstOrDefault(s => s.name == ComponentString.VALUE); foreach (var styleMap in rectangle?.styles) { if (rendererService.FileProvider.TryGetStyle(styleMap.Value, out FigmaStyle style)) { if (styleMap.Key == "fill") { colorWell.Color = CocoaHelpers.GetNSColor(style.name); } } } return(new View(colorWell)); }
/// <summary> /// The user chose a different text color from the "Text Color" color well /// </summary> /// <param name="sender"> /// A <see cref="NSColorWell"/> /// </param> partial void setTextColor(NSColorWell sender) { datePickerControl.TextColor = sender.Color; }
/// <summary> /// The user chose a different background color from the "Back Color" color well /// </summary> /// <param name="sender"> /// A <see cref="NSColorWell"/> /// </param> partial void setBackgroundColor(NSColorWell sender) { datePickerControl.BackgroundColor = sender.Color; }
/// <summary> /// The user chose a different text color from the "Text Color" color well /// </summary> /// <param name="sender"> /// A <see cref="NSColorWell"/> /// </param> partial void setTextColor (NSColorWell sender) { datePickerControl.TextColor = sender.Color; }
/// <summary> /// The user chose a different background color from the "Back Color" color well /// </summary> /// <param name="sender"> /// A <see cref="NSColorWell"/> /// </param> partial void setBackgroundColor (NSColorWell sender) { datePickerControl.BackgroundColor = sender.Color; }
public void TakeSelectionColorFrom(NSColorWell sender) { this.SelectionMarker.setColor(sender.Color); this.NeedsDisplay = true; }