public static SKColor ToSKColor(IColor color) { return(color switch { IArgbColor argbColor => new SKColor(argbColor.R, argbColor.G, argbColor.B, argbColor.A), _ => throw new NotSupportedException($"The {color.GetType()} color type is not supported."), });
public CStyleApplier SetFont(string fontName, short size, IArgbColor color) { Font.FontName = fontName; Font.FontSize = size; Font.FontColor = color; return(this); }
public static XSSFColor GetXSSFColor(IArgbColor color) { if (color.Alpha == 0) { return(null); } return(new XSSFColor(new[] { color.Red, color.Green, color.Blue })); }
private SolidColorBrush ToSolidColorBrush(IArgbColor color) { if (color == null) { throw new ArgumentNullException("color"); } return(new SolidColorBrush(Color.FromArgb(color.Alpha, color.Red, color.Green, color.Blue))); }
/// <summary> /// Clones color. /// </summary> /// <param name="argbColor">The argb color to clone.</param> /// <returns>The new instance of the <see cref="ArgbColor"/> class.</returns> public static IArgbColor Clone(this IArgbColor argbColor) { return(new ArgbColor() { A = argbColor.A, R = argbColor.R, G = argbColor.G, B = argbColor.B }); }
public CStyleApplier CellColor(IArgbColor foregroundColor, IArgbColor backgroundColor, FillPattern pattern) { FillForegroundColor = foregroundColor; FillBackgroundColor = backgroundColor; if (ExcelColor.GetIndex(foregroundColor) == ExcelColor.AutomaticIndex && ExcelColor.GetIndex(backgroundColor) == ExcelColor.AutomaticIndex) { FillPattern = FillPattern.NoFill; } else { FillPattern = pattern; } return(this); }
public CStyleApplier CellColor(IArgbColor foregroundColor) => CellColor(foregroundColor, ExcelColor.Automatic, FillPattern.SolidForeground);
public static AM.Color ToColor(IArgbColor argbColor) { return(AM.Color.FromArgb(argbColor.A, argbColor.R, argbColor.G, argbColor.B)); }