CanvasSkin

References
public sealed class CanvasSkin : IStorable
Immutable collection of canvas skin settings.

Constructors

CanvasSkin

#
public CanvasSkin(GridSkin gridSkin, Color foreground, Color background, Color edge, float backgroundNoise)
Create a new canvas skin.
gridSkin (GridSkin)
foreground (Color)
background (Color)
edge (Color)
backgroundNoise (float)

Fields

DefaultDim

#
public static readonly CanvasSkin DefaultDim
The default canvas skin used for regular GH documents in dark mode.

DefaultLit

#
public static readonly CanvasSkin DefaultLit
The default canvas skin used for regular GH documents in bright mode.

Properties

Background

#
public Color Background { get; }
Gets the canvas background colour, the portion to the left or up of the origin.

BackgroundNoise

#
public float BackgroundNoise { get; }
Gets the noise strength for the background.

Edge

#
public Color Edge { get; }
Gets the colour of the canvas edge.

Foreground

#
public Color Foreground { get; }
Gets the canvas foreground colour, the portion to the right and bottom of the origin.

GridSkin

#
public GridSkin GridSkin { get; }
Gets the grid properties of this canvas.

Methods

DrawCanvas

#
public void DrawCanvas(Graphics graphics, Projection projection, RectangleF bounds, float minorFade, float majorFade)
Draw this canvas skin to a graphics context.
graphics (Graphics)Graphics object.
projection (Projection)Projection.
bounds (RectangleF)Visible bounds.
minorFade (float)Fade factor for minor grid lines.
majorFade (float)Face factor for major grid lines.
Explicit

IStorable.Store

#
void IStorable.Store(IWriter writer)
writer (IWriter)
Store

Interpolate

#
public CanvasSkin Interpolate(CanvasSkin other, float factor)
Interpolate two canvas skins.
other (CanvasSkin)
factor (float)

WithBackground

#
public CanvasSkin WithBackground(Color background, float noise)
Create a canvas skin with a different background colour.
background (Color)
noise (float)

WithEdge

#
public CanvasSkin WithEdge(Color edge)
Create a canvas skin with a different edge colour.
edge (Color)

WithForeground

#
public CanvasSkin WithForeground(Color foreground)
Create a canvas skin with a different foreground colour.
foreground (Color)

WithGrid

#
public CanvasSkin WithGrid(GridSkin grid)
Create a canvas skin with different grid properties.
grid (GridSkin)