public static Color ToGdipColor(this ColorRgba128Float color, MidpointRounding roundingMode = 1) { byte red = Int32Util.ClampToByte((int)Math.Round((double)(color.r * 255.0), roundingMode)); byte green = Int32Util.ClampToByte((int)Math.Round((double)(color.g * 255.0), roundingMode)); byte blue = Int32Util.ClampToByte((int)Math.Round((double)(color.b * 255.0), roundingMode)); return(Color.FromArgb(Int32Util.ClampToByte((int)Math.Round((double)(color.a * 255.0), roundingMode)), red, green, blue)); }
private static LinearGradientBrush CreateBackHighlightBrush() { LinearGradientBrush brush = new LinearGradientBrush(); brush.GradientStops.Add(new GradientStop(ColorRgba128Float.Blend((ColorRgba128Float)ColorBgra.White, (ColorRgba128Float)PaintDotNet.Imaging.SystemColors.Highlight, 0.8f), 0.0)); brush.GradientStops.Add(new GradientStop(ColorRgba128Float.Blend((ColorRgba128Float)ColorBgra.White, (ColorRgba128Float)PaintDotNet.Imaging.SystemColors.Highlight, 0.8f), 1.0)); brush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation; brush.SpreadMethod = GradientSpreadMethod.Pad; return(brush); }
private static LinearGradientBrush CreateBackNormalBrush() { LinearGradientBrush brush = new LinearGradientBrush(); brush.GradientStops.Add(new GradientStop(AeroColors.ToolBarBackFillGradTopColor, 0.0)); ColorRgba128Float color = ColorRgba128Float.Blend(AeroColors.ToolBarBackFillGradTopColor, AeroColors.ToolBarBackFillGradMidColor, 0.33f); brush.GradientStops.Add(new GradientStop(color, 1.0)); brush.ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation; brush.SpreadMethod = GradientSpreadMethod.Pad; return(brush); }
protected override void OnRender(IDrawingContext dc, RectFloat clipRect, CanvasView canvasView) { SizeDouble canvasSize = canvasView.CanvasSize; RectDouble num2 = RectDouble.FromEdges(-131072.0, 0.0, 0.0, canvasSize.Height); RectDouble num3 = RectDouble.FromEdges(-131072.0, -131072.0, 131072.0, 0.0); RectDouble num4 = RectDouble.FromEdges(canvasSize.Width, 0.0, 131072.0, canvasSize.Height); RectDouble num5 = RectDouble.FromEdges(-131072.0, canvasSize.Height, 131072.0, 131072.0); ColorRgba128Float num6 = (ThemeConfig.EffectiveTheme == PdnTheme.Aero) ? AeroColors.CanvasBackFillColor : ClassicColors.CanvasBackFillColor; dc.Clear((RectFloat)num2, AntialiasMode.Aliased, new ColorRgba128Float?(num6)); dc.Clear((RectFloat)num3, AntialiasMode.Aliased, new ColorRgba128Float?(num6)); dc.Clear((RectFloat)num4, AntialiasMode.Aliased, new ColorRgba128Float?(num6)); dc.Clear((RectFloat)num5, AntialiasMode.Aliased, new ColorRgba128Float?(num6)); base.OnRender(dc, clipRect, canvasView); }
public ISolidColorBrush CreateSolidColorBrush(ColorRgba128Float color, BrushProperties?brushProperties) => base.innerRefT.CreateSolidColorBrush(color, brushProperties);