Search Results for

    Show / Hide Table of Contents

    Class ColorBlend

    Defines arrays of colors and positions used for interpolating color blending in a multicolor gradient.

    Inheritance
    object
    ColorBlend
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Styles.Thematics
    Assembly: Mapsui.dll
    Syntax
    public class ColorBlend

    Constructors

    | Edit this page View Source

    ColorBlend(Color[], double[])

    Initializes a new instance of the ColorBlend class.

    Declaration
    public ColorBlend(Color[] colors, double[] positions)
    Parameters
    Type Name Description
    Color[] colors

    An array of Color structures that represents the colors to use at corresponding positions along a gradient.

    double[] positions

    An array of values that specify percentages of distance along the gradient line.

    Properties

    | Edit this page View Source

    BlackToWhite

    Gets a linear gradient scale from black to white

    Declaration
    public static ColorBlend BlackToWhite { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    BlueToGreen

    Gets a linear gradient scale from blue to green

    Declaration
    public static ColorBlend BlueToGreen { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    BlueToRed

    Gets a linear gradient scale from blue to red

    Declaration
    public static ColorBlend BlueToRed { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    Colors

    Gets or sets an array of colors that represents the colors to use at corresponding positions along a gradient.

    Declaration
    public Color[]? Colors { get; set; }
    Property Value
    Type Description
    Color[]
    | Edit this page View Source

    GreenToBlue

    Gets a linear gradient scale from green to blue

    Declaration
    public static ColorBlend GreenToBlue { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    GreenToRed

    Gets a linear gradient scale from green to red

    Declaration
    public static ColorBlend GreenToRed { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    Positions

    Gets or sets the positions along a gradient line.

    Declaration
    public double[]? Positions { get; set; }
    Property Value
    Type Description
    double[]

    An array of values that specify percentages of distance along the gradient line.

    Remarks

    The elements of this array specify percentages of distance along the gradient line. For example, an element value of 0.2f specifies that this point is 20 percent of the total distance from the starting point. The elements in this array are represented by float values between 0.0f and 1.0f, and the first element of the array must be 0.0f and the last element must be 1.0f.

    Along with the Colors property, this property defines a multicolor gradient.
    | Edit this page View Source

    Rainbow5

    Gets a linear gradient scale with five colors making a rainbow from red to blue.

    Declaration
    public static ColorBlend Rainbow5 { get; }
    Property Value
    Type Description
    ColorBlend
    Remarks

    Colors span the following with an interval of 0.25: { Color.Red, Color.Yellow, Color.Green, Color.Cyan, Color.Blue }

    | Edit this page View Source

    Rainbow7

    Gets a linear gradient scale with seven colors making a rainbow from red to violet.

    Declaration
    public static ColorBlend Rainbow7 { get; }
    Property Value
    Type Description
    ColorBlend
    Remarks

    Colors span the following with an interval of 1/6: { Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Blue, Color.Indigo, Color.Violet }

    | Edit this page View Source

    RedToBlue

    Gets a linear gradient scale from red to blue

    Declaration
    public static ColorBlend RedToBlue { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    RedToGreen

    Gets a linear gradient scale from red to green

    Declaration
    public static ColorBlend RedToGreen { get; }
    Property Value
    Type Description
    ColorBlend
    | Edit this page View Source

    WhiteToBlack

    Gets a linear gradient scale from white to black

    Declaration
    public static ColorBlend WhiteToBlack { get; }
    Property Value
    Type Description
    ColorBlend

    Methods

    | Edit this page View Source

    GetColor(double)

    Gets the color from the scale at position 'pos'.

    Declaration
    public Color GetColor(double pos)
    Parameters
    Type Name Description
    double pos

    Position on scale between 0.0f and 1.0f

    Returns
    Type Description
    Color

    Color on scale

    Remarks

    If the position is outside the scale [0..1] only the fractional part is used (in other words the scale restarts for each integer-part).

    | Edit this page View Source

    ThreeColors(Color, Color, Color)

    Creates a linear gradient scale from three colors

    Declaration
    public static ColorBlend ThreeColors(Color fromColor, Color middleColor, Color toColor)
    Parameters
    Type Name Description
    Color fromColor
    Color middleColor
    Color toColor
    Returns
    Type Description
    ColorBlend
    | Edit this page View Source

    TwoColors(Color, Color)

    Creates a linear gradient scale from two colors

    Declaration
    public static ColorBlend TwoColors(Color fromColor, Color toColor)
    Parameters
    Type Name Description
    Color fromColor
    Color toColor
    Returns
    Type Description
    ColorBlend
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX