dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Model

MapColor Class

Creates a new color object by passing either a hex, rgb(a), hsl(a) or named color value. Hex, hsl(a) and named color values can be passed as a string: ArcGIS Maps SDK for JavaScript

public sealed record MapColor : System.Collections.IEnumerable, System.IEquatable<dymaptic.GeoBlazor.Core.Model.MapColor>

Inheritance System.Object 🡒 MapColor

Implements System.Collections.IEnumerable, System.IEquatable<MapColor>

Constructors

MapColor() Constructor

Parameterless constructor for Protobuf deserialization. Not intended for public use.

public MapColor();

MapColor(string) Constructor

Creates a new color with a common color name, or a hex value starting with the # sign.

public MapColor(string hexOrNameValue);

Parameters

hexOrNameValue System.String

The value of the hex or name.

MapColor(IReadOnlyList) Constructor

Creates a new color with a collection of numeric values in rgb or rgba format.

public MapColor(System.Collections.Generic.IReadOnlyList<double> values);

Parameters

values System.Collections.Generic.IReadOnlyList<System.Double>

Requires 3 or 4 values, in the order R(0-255), G(0-255), B(0-255), A(0-1). A is optional.

Properties

MapColor.HexOrNameValue Property

The name or hex value of the color.

public string? HexOrNameValue { get; }

Property Value

System.String

MapColor.RgbaValues Property

The numeric values for calculating a color (rgb/rgba).

public double[]? RgbaValues { get; }

Property Value

System.Double[]

Methods

MapColor.Add(double) Method

For internal use only, used to support Collection Expressions and implicit conversions from arrays/lists.

public void Add(double val);

Parameters

val System.Double

MapColor.BlendColors(MapColor, MapColor, double) Method

Creates a Color instance by blending two colors using a weight factor.

public static dymaptic.GeoBlazor.Core.Model.MapColor? BlendColors(dymaptic.GeoBlazor.Core.Model.MapColor start, dymaptic.GeoBlazor.Core.Model.MapColor end, double weight);

Parameters

start MapColor

The start color.

end MapColor

The end color.

weight System.Double

The weight factor. 0 means the start color, 1 means the end color, 0.5 means a 50/50 blend.

Returns

MapColor
A new color instance representing the blended color, or null if the colors could not be blended.

MapColor.Equals(MapColor) Method

public bool Equals(dymaptic.GeoBlazor.Core.Model.MapColor? other);

Parameters

other MapColor

Returns

System.Boolean

MapColor.GetEnumerator() Method

Provides support for Collection Expressions.

public System.Collections.IEnumerator GetEnumerator();

Implements GetEnumerator()

Returns

System.Collections.IEnumerator

MapColor.GetHashCode() Method

Serves as the default hash function.

public override int GetHashCode();

Returns

System.Int32
A hash code for the current object.

MapColor.ToCss() Method

Returns a CSS color string in rgba form representing the Color instance. ArcGIS Maps SDK for JavaScript

public string? ToCss();

Returns

System.String

MapColor.ToHex() Method

Returns the color in hexadecimal format. ArcGIS Maps SDK for JavaScript

public string? ToHex();

Returns

System.String

MapColor.ToSystemColor() Method

Returns a System.Drawing.Color instance representing the Color instance.

public System.Nullable<System.Drawing.Color> ToSystemColor();

Returns

System.Nullable<System.Drawing.Color>

Operators

MapColor.implicit operator MapColor(double[]) Operator

Implicitly converts a numeric array to a GeoBlazor MapColor instance.

public static dymaptic.GeoBlazor.Core.Model.MapColor implicit operator dymaptic.GeoBlazor.Core.Model.MapColor(double[] rgbaValues);

Parameters

rgbaValues System.Double[]

Returns

MapColor

MapColor.implicit operator MapColor(string) Operator

Implicitly converts a color hex or name value to a GeoBlazor MapColor instance.

public static dymaptic.GeoBlazor.Core.Model.MapColor implicit operator dymaptic.GeoBlazor.Core.Model.MapColor(string hexOrNameValue);

Parameters

hexOrNameValue System.String

Returns

MapColor

MapColor.implicit operator MapColor(List) Operator

Implicitly converts a numeric array to a GeoBlazor MapColor instance.

public static dymaptic.GeoBlazor.Core.Model.MapColor implicit operator dymaptic.GeoBlazor.Core.Model.MapColor(System.Collections.Generic.List<double> rgbaValues);

Parameters

rgbaValues System.Collections.Generic.List<System.Double>

Returns

MapColor

MapColor.implicit operator string(MapColor) Operator

Implicitly converts a GeoBlazor MapColor instance to a hex or name value.

public static string? implicit operator string?(dymaptic.GeoBlazor.Core.Model.MapColor color);

Parameters

color MapColor

Returns

System.String