Struct Color
Assembly: Mapsui.dll
Syntax
public readonly record struct Color : IEquatable<Color>
Constructors
|
Edit this page
View Source
Color()
Declaration
|
Edit this page
View Source
Color(Color)
Declaration
public Color(Color color)
Parameters
| Type |
Name |
Description |
| Color |
color |
|
|
Edit this page
View Source
Color(int, int, int, int)
Declaration
public Color(int red, int green, int blue, int alpha = 255)
Parameters
Properties
|
Edit this page
View Source
A
Declaration
public int A { get; init; }
Property Value
|
Edit this page
View Source
AliceBlue
Declaration
public static Color AliceBlue { get; }
Property Value
|
Edit this page
View Source
AntiqueWhite
Declaration
public static Color AntiqueWhite { get; }
Property Value
|
Edit this page
View Source
Aqua
Declaration
public static Color Aqua { get; }
Property Value
|
Edit this page
View Source
Aquamarine
Declaration
public static Color Aquamarine { get; }
Property Value
|
Edit this page
View Source
Azure
Declaration
public static Color Azure { get; }
Property Value
|
Edit this page
View Source
B
Declaration
public int B { get; init; }
Property Value
|
Edit this page
View Source
Beige
Declaration
public static Color Beige { get; }
Property Value
|
Edit this page
View Source
Bisque
Declaration
public static Color Bisque { get; }
Property Value
|
Edit this page
View Source
Black
Declaration
public static Color Black { get; }
Property Value
|
Edit this page
View Source
BlanchedAlmond
Declaration
public static Color BlanchedAlmond { get; }
Property Value
|
Edit this page
View Source
Blue
Declaration
public static Color Blue { get; }
Property Value
|
Edit this page
View Source
BlueViolet
Declaration
public static Color BlueViolet { get; }
Property Value
|
Edit this page
View Source
Brown
Declaration
public static Color Brown { get; }
Property Value
|
Edit this page
View Source
BurlyWood
Declaration
public static Color BurlyWood { get; }
Property Value
|
Edit this page
View Source
CadetBlue
Declaration
public static Color CadetBlue { get; }
Property Value
|
Edit this page
View Source
Chartreuse
Declaration
public static Color Chartreuse { get; }
Property Value
|
Edit this page
View Source
Chocolate
Declaration
public static Color Chocolate { get; }
Property Value
|
Edit this page
View Source
Coral
Declaration
public static Color Coral { get; }
Property Value
|
Edit this page
View Source
CornflowerBlue
Declaration
public static Color CornflowerBlue { get; }
Property Value
|
Edit this page
View Source
Cornsilk
Declaration
public static Color Cornsilk { get; }
Property Value
|
Edit this page
View Source
Crimson
Declaration
public static Color Crimson { get; }
Property Value
|
Edit this page
View Source
Cyan
Declaration
public static Color Cyan { get; }
Property Value
|
Edit this page
View Source
DarkBlue
Declaration
public static Color DarkBlue { get; }
Property Value
|
Edit this page
View Source
DarkCyan
Declaration
public static Color DarkCyan { get; }
Property Value
|
Edit this page
View Source
DarkGoldenRod
Declaration
public static Color DarkGoldenRod { get; }
Property Value
|
Edit this page
View Source
DarkGray
Declaration
public static Color DarkGray { get; }
Property Value
|
Edit this page
View Source
DarkGreen
Declaration
public static Color DarkGreen { get; }
Property Value
|
Edit this page
View Source
DarkGrey
Declaration
public static Color DarkGrey { get; }
Property Value
|
Edit this page
View Source
DarkKhaki
Declaration
public static Color DarkKhaki { get; }
Property Value
|
Edit this page
View Source
DarkMagenta
Declaration
public static Color DarkMagenta { get; }
Property Value
|
Edit this page
View Source
DarkOliveGreen
Declaration
public static Color DarkOliveGreen { get; }
Property Value
|
Edit this page
View Source
DarkOrange
Declaration
public static Color DarkOrange { get; }
Property Value
|
Edit this page
View Source
DarkOrchid
Declaration
public static Color DarkOrchid { get; }
Property Value
|
Edit this page
View Source
DarkRed
Declaration
public static Color DarkRed { get; }
Property Value
|
Edit this page
View Source
DarkSalmon
Declaration
public static Color DarkSalmon { get; }
Property Value
|
Edit this page
View Source
DarkSeaGreen
Declaration
public static Color DarkSeaGreen { get; }
Property Value
|
Edit this page
View Source
DarkSlateBlue
Declaration
public static Color DarkSlateBlue { get; }
Property Value
|
Edit this page
View Source
DarkSlateGray
Declaration
public static Color DarkSlateGray { get; }
Property Value
|
Edit this page
View Source
DarkSlateGrey
Declaration
public static Color DarkSlateGrey { get; }
Property Value
|
Edit this page
View Source
DarkTurquoise
Declaration
public static Color DarkTurquoise { get; }
Property Value
|
Edit this page
View Source
DarkViolet
Declaration
public static Color DarkViolet { get; }
Property Value
|
Edit this page
View Source
DeepPink
Declaration
public static Color DeepPink { get; }
Property Value
|
Edit this page
View Source
DeepSkyBlue
Declaration
public static Color DeepSkyBlue { get; }
Property Value
|
Edit this page
View Source
DimGray
Declaration
public static Color DimGray { get; }
Property Value
|
Edit this page
View Source
DimGrey
Declaration
public static Color DimGrey { get; }
Property Value
|
Edit this page
View Source
DodgerBlue
Declaration
public static Color DodgerBlue { get; }
Property Value
|
Edit this page
View Source
FireBrick
Declaration
public static Color FireBrick { get; }
Property Value
|
Edit this page
View Source
FloralWhite
Declaration
public static Color FloralWhite { get; }
Property Value
|
Edit this page
View Source
ForestGreen
Declaration
public static Color ForestGreen { get; }
Property Value
|
Edit this page
View Source
Fuchsia
Declaration
public static Color Fuchsia { get; }
Property Value
|
Edit this page
View Source
G
Declaration
public int G { get; init; }
Property Value
|
Edit this page
View Source
Gainsboro
Declaration
public static Color Gainsboro { get; }
Property Value
|
Edit this page
View Source
GhostWhite
Declaration
public static Color GhostWhite { get; }
Property Value
|
Edit this page
View Source
Gold
Declaration
public static Color Gold { get; }
Property Value
|
Edit this page
View Source
GoldenRod
Declaration
public static Color GoldenRod { get; }
Property Value
|
Edit this page
View Source
Gray
Declaration
public static Color Gray { get; }
Property Value
|
Edit this page
View Source
Green
Declaration
public static Color Green { get; }
Property Value
|
Edit this page
View Source
GreenYellow
Declaration
public static Color GreenYellow { get; }
Property Value
|
Edit this page
View Source
Grey
Declaration
public static Color Grey { get; }
Property Value
|
Edit this page
View Source
HoneyDew
Declaration
public static Color HoneyDew { get; }
Property Value
|
Edit this page
View Source
HotPink
Declaration
public static Color HotPink { get; }
Property Value
|
Edit this page
View Source
IndianRed
Declaration
public static Color IndianRed { get; }
Property Value
|
Edit this page
View Source
Indigo
Declaration
public static Color Indigo { get; }
Property Value
|
Edit this page
View Source
Ivory
Declaration
public static Color Ivory { get; }
Property Value
|
Edit this page
View Source
Khaki
Declaration
public static Color Khaki { get; }
Property Value
|
Edit this page
View Source
Lavender
Declaration
public static Color Lavender { get; }
Property Value
|
Edit this page
View Source
LavenderBlush
Declaration
public static Color LavenderBlush { get; }
Property Value
|
Edit this page
View Source
LawnGreen
Declaration
public static Color LawnGreen { get; }
Property Value
|
Edit this page
View Source
LemonChiffon
Declaration
public static Color LemonChiffon { get; }
Property Value
|
Edit this page
View Source
LightBlue
Declaration
public static Color LightBlue { get; }
Property Value
|
Edit this page
View Source
LightCoral
Declaration
public static Color LightCoral { get; }
Property Value
|
Edit this page
View Source
LightCyan
Declaration
public static Color LightCyan { get; }
Property Value
|
Edit this page
View Source
LightGoldenRodYellow
Declaration
public static Color LightGoldenRodYellow { get; }
Property Value
|
Edit this page
View Source
LightGray
Declaration
public static Color LightGray { get; }
Property Value
|
Edit this page
View Source
LightGreen
Declaration
public static Color LightGreen { get; }
Property Value
|
Edit this page
View Source
LightGrey
Declaration
public static Color LightGrey { get; }
Property Value
|
Edit this page
View Source
LightPink
Declaration
public static Color LightPink { get; }
Property Value
|
Edit this page
View Source
LightSalmon
Declaration
public static Color LightSalmon { get; }
Property Value
|
Edit this page
View Source
LightSeaGreen
Declaration
public static Color LightSeaGreen { get; }
Property Value
|
Edit this page
View Source
LightSkyBlue
Declaration
public static Color LightSkyBlue { get; }
Property Value
|
Edit this page
View Source
LightSlateGray
Declaration
public static Color LightSlateGray { get; }
Property Value
|
Edit this page
View Source
LightSlateGrey
Declaration
public static Color LightSlateGrey { get; }
Property Value
|
Edit this page
View Source
LightSteelBlue
Declaration
public static Color LightSteelBlue { get; }
Property Value
|
Edit this page
View Source
LightYellow
Declaration
public static Color LightYellow { get; }
Property Value
|
Edit this page
View Source
Lime
Declaration
public static Color Lime { get; }
Property Value
|
Edit this page
View Source
LimeGreen
Declaration
public static Color LimeGreen { get; }
Property Value
|
Edit this page
View Source
Linen
Declaration
public static Color Linen { get; }
Property Value
|
Edit this page
View Source
Magenta
Declaration
public static Color Magenta { get; }
Property Value
|
Edit this page
View Source
Maroon
Declaration
public static Color Maroon { get; }
Property Value
|
Edit this page
View Source
MediumAquaMarine
Declaration
public static Color MediumAquaMarine { get; }
Property Value
|
Edit this page
View Source
MediumBlue
Declaration
public static Color MediumBlue { get; }
Property Value
|
Edit this page
View Source
MediumOrchid
Declaration
public static Color MediumOrchid { get; }
Property Value
|
Edit this page
View Source
MediumPurple
Declaration
public static Color MediumPurple { get; }
Property Value
|
Edit this page
View Source
MediumSeaGreen
Declaration
public static Color MediumSeaGreen { get; }
Property Value
|
Edit this page
View Source
MediumSlateBlue
Declaration
public static Color MediumSlateBlue { get; }
Property Value
|
Edit this page
View Source
MediumSpringGreen
Declaration
public static Color MediumSpringGreen { get; }
Property Value
|
Edit this page
View Source
MediumTurquoise
Declaration
public static Color MediumTurquoise { get; }
Property Value
|
Edit this page
View Source
MediumVioletRed
Declaration
public static Color MediumVioletRed { get; }
Property Value
|
Edit this page
View Source
MidnightBlue
Declaration
public static Color MidnightBlue { get; }
Property Value
|
Edit this page
View Source
MintCream
Declaration
public static Color MintCream { get; }
Property Value
|
Edit this page
View Source
MistyRose
Declaration
public static Color MistyRose { get; }
Property Value
|
Edit this page
View Source
Moccasin
Declaration
public static Color Moccasin { get; }
Property Value
|
Edit this page
View Source
NavajoWhite
Declaration
public static Color NavajoWhite { get; }
Property Value
|
Edit this page
View Source
Navy
Declaration
public static Color Navy { get; }
Property Value
|
Edit this page
View Source
OldLace
Declaration
public static Color OldLace { get; }
Property Value
|
Edit this page
View Source
Olive
Declaration
public static Color Olive { get; }
Property Value
|
Edit this page
View Source
OliveDrab
Declaration
public static Color OliveDrab { get; }
Property Value
|
Edit this page
View Source
Orange
Declaration
public static Color Orange { get; }
Property Value
|
Edit this page
View Source
OrangeRed
Declaration
public static Color OrangeRed { get; }
Property Value
|
Edit this page
View Source
Orchid
Declaration
public static Color Orchid { get; }
Property Value
|
Edit this page
View Source
PaleGoldenRod
Declaration
public static Color PaleGoldenRod { get; }
Property Value
|
Edit this page
View Source
PaleGreen
Declaration
public static Color PaleGreen { get; }
Property Value
|
Edit this page
View Source
PaleTurquoise
Declaration
public static Color PaleTurquoise { get; }
Property Value
|
Edit this page
View Source
PaleVioletRed
Declaration
public static Color PaleVioletRed { get; }
Property Value
|
Edit this page
View Source
PapayaWhip
Declaration
public static Color PapayaWhip { get; }
Property Value
|
Edit this page
View Source
PeachPuff
Declaration
public static Color PeachPuff { get; }
Property Value
|
Edit this page
View Source
Peru
Declaration
public static Color Peru { get; }
Property Value
|
Edit this page
View Source
Pink
Declaration
public static Color Pink { get; }
Property Value
|
Edit this page
View Source
Plum
Declaration
public static Color Plum { get; }
Property Value
|
Edit this page
View Source
PowderBlue
Declaration
public static Color PowderBlue { get; }
Property Value
|
Edit this page
View Source
Purple
Declaration
public static Color Purple { get; }
Property Value
|
Edit this page
View Source
R
Declaration
public int R { get; init; }
Property Value
|
Edit this page
View Source
RebeccaPurple
Declaration
public static Color RebeccaPurple { get; }
Property Value
|
Edit this page
View Source
Red
Declaration
public static Color Red { get; }
Property Value
|
Edit this page
View Source
RosyBrown
Declaration
public static Color RosyBrown { get; }
Property Value
|
Edit this page
View Source
RoyalBlue
Declaration
public static Color RoyalBlue { get; }
Property Value
|
Edit this page
View Source
SaddleBrown
Declaration
public static Color SaddleBrown { get; }
Property Value
|
Edit this page
View Source
Salmon
Declaration
public static Color Salmon { get; }
Property Value
|
Edit this page
View Source
SandyBrown
Declaration
public static Color SandyBrown { get; }
Property Value
|
Edit this page
View Source
SeaGreen
Declaration
public static Color SeaGreen { get; }
Property Value
|
Edit this page
View Source
SeaShell
Declaration
public static Color SeaShell { get; }
Property Value
|
Edit this page
View Source
Sienna
Declaration
public static Color Sienna { get; }
Property Value
|
Edit this page
View Source
Silver
Declaration
public static Color Silver { get; }
Property Value
|
Edit this page
View Source
SkyBlue
Declaration
public static Color SkyBlue { get; }
Property Value
|
Edit this page
View Source
SlateBlue
Declaration
public static Color SlateBlue { get; }
Property Value
|
Edit this page
View Source
SlateGray
Declaration
public static Color SlateGray { get; }
Property Value
|
Edit this page
View Source
SlateGrey
Declaration
public static Color SlateGrey { get; }
Property Value
|
Edit this page
View Source
Snow
Declaration
public static Color Snow { get; }
Property Value
|
Edit this page
View Source
SpringGreen
Declaration
public static Color SpringGreen { get; }
Property Value
|
Edit this page
View Source
SteelBlue
Declaration
public static Color SteelBlue { get; }
Property Value
|
Edit this page
View Source
Tan
Declaration
public static Color Tan { get; }
Property Value
|
Edit this page
View Source
Teal
Declaration
public static Color Teal { get; }
Property Value
|
Edit this page
View Source
Thistle
Declaration
public static Color Thistle { get; }
Property Value
|
Edit this page
View Source
Tomato
Declaration
public static Color Tomato { get; }
Property Value
|
Edit this page
View Source
Transparent
Declaration
public static Color Transparent { get; }
Property Value
|
Edit this page
View Source
Turquoise
Declaration
public static Color Turquoise { get; }
Property Value
|
Edit this page
View Source
Violet
Declaration
public static Color Violet { get; }
Property Value
|
Edit this page
View Source
Wheat
Declaration
public static Color Wheat { get; }
Property Value
|
Edit this page
View Source
White
Declaration
public static Color White { get; }
Property Value
|
Edit this page
View Source
WhiteSmoke
Declaration
public static Color WhiteSmoke { get; }
Property Value
|
Edit this page
View Source
Yellow
Declaration
public static Color Yellow { get; }
Property Value
|
Edit this page
View Source
YellowGreen
Declaration
public static Color YellowGreen { get; }
Property Value
Methods
|
Edit this page
View Source
FromArgb(int, int, int, int)
Declaration
public static Color FromArgb(int a, int r, int g, int b)
Parameters
Returns
|
Edit this page
View Source
FromHsl(float, float, float, int)
Declaration
public static Color FromHsl(float h, float s, float l, int a = 255)
Parameters
Returns
|
Edit this page
View Source
FromRgba(int, int, int, int)
Declaration
public static Color FromRgba(int r, int g, int b, int a)
Parameters
Returns
|
Edit this page
View Source
FromString(string)
Converts a string in Mapbox GL format to a Mapsui Color
This function assumes, that alpha is a float in range from 0.0 to 1.0.
It converts this float in Mapsui Color alpha without rounding.
The following colors could be converted:
- Named colors with known Html names
- Colors as Html color values with leading '#' and 6 or 3 numbers
- Function rgb(r,g,b) with values for red, green and blue
- Function rgba(r,g,b,a) with values for red, green, blue and alpha. Here alpha is between 0.0 and 1.0 like opacity.
- Function hsl(h,s,l) with values hue (0.0 to 360.0), saturation (0.0% - 100.0%) and lightness (0.0% - 100.0%)
- Function hsla(h,s,l,a) with values hue (0.0 to 360.0), saturation (0.0% - 100.0%), lightness (0.0% - 100.0%) and alpha. Here alpha is between 0.0 and 1.0 like opacity.
Declaration
public static Color FromString(string from)
Parameters
| Type |
Name |
Description |
| string |
from |
String with HTML color representation or function like rgb() or hsl()
|
Returns
| Type |
Description |
| Color |
Converted Mapsui Color
|
|
Edit this page
View Source
Opacity(Color, float?)
Change alpha channel from given color to respect opacity
Declaration
public static Color Opacity(Color color, float? opacity)
Parameters
| Type |
Name |
Description |
| Color |
color |
Mapsui Color to change
|
| float? |
opacity |
Opacity of the new color
|
Returns
| Type |
Description |
| Color |
New color respecting old alpha and new opacity
|
|
Edit this page
View Source
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type |
Description |
| string |
The fully qualified type name.
|
Overrides
Operators
|
Edit this page
View Source
explicit operator Color(Color)
Declaration
public static explicit operator Color(Color color)
Parameters
| Type |
Name |
Description |
| Color |
color |
|
Returns
|
Edit this page
View Source
explicit operator Color(Color)
Declaration
public static explicit operator Color(Color color)
Parameters
| Type |
Name |
Description |
| Color |
color |
|
Returns
Implements
Extension Methods