ScottPlot
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
ScottPlot.Color Struct Reference

Public Member Functions

override string ToString ()
 
 Color (byte red, byte green, byte blue, byte alpha=255)
 
 Color (float red, float green, float blue, float alpha=1)
 
 Color (string hexCode)
 
 Color (uint argb)
 
 Color (SKColor color)
 
 Color (System.Drawing.Color color)
 
override int GetHashCode ()
 
override bool Equals (object? obj)
 
readonly Color WithRed (byte red)
 
readonly Color WithGreen (byte green)
 
readonly Color WithBlue (byte blue)
 
readonly Color WithAlpha (byte alpha)
 
readonly Color WithAlpha (double alpha)
 
readonly Color WithOpacity (double opacity=.5)
 
string ToHex ()
 return a string like "#6699AA" or "#6699AA42" if a semitransparent alpha is in use
 
string ToStringRGB ()
 return a string like "#6699AA"
 
string ToStringRGBA ()
 return a string like "#6699AAFF"
 
SkiaSharp.SKColor ToSKColor ()
 Create a SkiaSharp color.
 
System.Drawing.Color ToSDColor ()
 Create a System Drawing color.
 
float float float l ToHSL ()
 
Color WithLightness (float lightness=.5f)
 
Color Lighten (double fraction=.5f)
 Amount to lighten the color (from 0-1). Larger numbers produce lighter results.
 
Color Darken (double fraction=.5f)
 Amount to darken the color (from 0-1). Larger numbers produce darker results.
 
Color MixedWith (Color otherColor, double fraction)
 Return this color mixed with another color.
 
Color InterpolateRgb (Color c1, double fraction)
 
Color[] InterpolateArrayRgb (Color c1, int steps)
 

Static Public Member Functions

static bool operator== (Color a, Color b)
 
static bool operator!= (Color a, Color b)
 
static Color Gray (byte value)
 
static Color FromARGB (int argb)
 
static Color FromARGB (uint argb)
 
static Color FromHex (string hex)
 
static Color FromHtml (string html)
 
static Color[] FromHex (IEnumerable< string > hex)
 Create a collection of colors from a collection of hex strings formatted like "#66AA99".
 
static Color FromColor (System.Drawing.Color color)
 Create a ScottPlot color from a System Drawing Color.
 
static Color FromSKColor (SKColor skcolor)
 Create a ScottPlot color from a SkiaSharp Color.
 
static Color FromSDColor (System.Drawing.Color sdColor)
 Create a ScottPlot color from a System Drawing Color.
 
static Color FromHSL (float hue, float saturation, float luminosity, float alpha=1)
 Create a Color given Hue, Saturation, and Luminance (as fractions from 0 to 1)
 
static byte InterpolateRgb (byte b1, byte b2, double fraction)
 
static Color InterpolateRgb (Color c1, Color c2, double fraction)
 
static Color[] InterpolateRgbArray (Color c1, Color c2, int steps)
 
static Color RandomHue ()
 
static System.Drawing.Color ToColor (ScottPlot.Color color)
 

Public Attributes

readonly byte Red
 
readonly byte Green
 
readonly byte Blue
 
readonly byte Alpha
 
float h
 Hue, Saturation, and Luminance (as fractions from 0 to 1)
 
float float s
 

Properties

byte R [get]
 
byte G [get]
 
byte B [get]
 
byte A [get]
 
uint ARGB [get]
 
uint PremultipliedARGB [get]
 
float Luminance [get]
 Luminance as a fraction from 0 to 1.
 
float Hue [get]
 Hue as a fraction from 0 to 1.
 
float Saturation [get]
 Saturation as a fraction from 0 to 1.
 

Constructor & Destructor Documentation

◆ Color() [1/6]

ScottPlot.Color.Color ( byte  red,
byte  green,
byte  blue,
byte  alpha = 255 
)
inline

◆ Color() [2/6]

ScottPlot.Color.Color ( float  red,
float  green,
float  blue,
float  alpha = 1 
)
inline

◆ Color() [3/6]

ScottPlot.Color.Color ( string  hexCode)
inline

◆ Color() [4/6]

ScottPlot.Color.Color ( uint  argb)
inline

◆ Color() [5/6]

ScottPlot.Color.Color ( SKColor  color)
inline

◆ Color() [6/6]

ScottPlot.Color.Color ( System::Drawing::Color  color)
inline

Member Function Documentation

◆ Darken()

Color ScottPlot.Color.Darken ( double  fraction = ::5f)
inline

Amount to darken the color (from 0-1). Larger numbers produce darker results.

◆ Equals()

override bool ScottPlot.Color.Equals ( object?  obj)
inline

◆ FromARGB() [1/2]

static Color ScottPlot.Color.FromARGB ( int  argb)
inlinestatic

◆ FromARGB() [2/2]

static Color ScottPlot.Color.FromARGB ( uint  argb)
inlinestatic

◆ FromColor()

static Color ScottPlot.Color.FromColor ( System::Drawing::Color  color)
inlinestatic

Create a ScottPlot color from a System Drawing Color.

◆ FromHex() [1/2]

static Color[] ScottPlot.Color.FromHex ( IEnumerable< string >  hex)
inlinestatic

Create a collection of colors from a collection of hex strings formatted like "#66AA99".

◆ FromHex() [2/2]

static Color ScottPlot.Color.FromHex ( string  hex)
static

◆ FromHSL()

static Color ScottPlot.Color.FromHSL ( float  hue,
float  saturation,
float  luminosity,
float  alpha = 1 
)
inlinestatic

Create a Color given Hue, Saturation, and Luminance (as fractions from 0 to 1)

◆ FromHtml()

static Color ScottPlot.Color.FromHtml ( string  html)
static

◆ FromSDColor()

static Color ScottPlot.Color.FromSDColor ( System::Drawing::Color  sdColor)
inlinestatic

Create a ScottPlot color from a System Drawing Color.

◆ FromSKColor()

static Color ScottPlot.Color.FromSKColor ( SKColor  skcolor)
inlinestatic

Create a ScottPlot color from a SkiaSharp Color.

◆ GetHashCode()

override int ScottPlot.Color.GetHashCode ( )
inline

◆ Gray()

static Color ScottPlot.Color.Gray ( byte  value)
static

◆ InterpolateArrayRgb()

Color[] ScottPlot.Color.InterpolateArrayRgb ( Color  c1,
int  steps 
)
inline

◆ InterpolateRgb() [1/3]

static byte ScottPlot.Color.InterpolateRgb ( byte  b1,
byte  b2,
double  fraction 
)
inlinestatic

◆ InterpolateRgb() [2/3]

static Color ScottPlot.Color.InterpolateRgb ( Color  c1,
Color  c2,
double  fraction 
)
inlinestatic

◆ InterpolateRgb() [3/3]

Color ScottPlot.Color.InterpolateRgb ( Color  c1,
double  fraction 
)
inline

◆ InterpolateRgbArray()

static Color[] ScottPlot.Color.InterpolateRgbArray ( Color  c1,
Color  c2,
int  steps 
)
inlinestatic

◆ Lighten()

Color ScottPlot.Color.Lighten ( double  fraction = ::5f)
inline

Amount to lighten the color (from 0-1). Larger numbers produce lighter results.

◆ MixedWith()

Color ScottPlot.Color.MixedWith ( Color  otherColor,
double  fraction 
)
inline

Return this color mixed with another color.

Parameters
otherColorColor to mix with this color
fractionFraction of otherColor to use
Returns

◆ operator!=()

static bool ScottPlot.Color.operator!= ( Color  a,
Color  b 
)
inlinestatic

◆ operator==()

static bool ScottPlot.Color.operator== ( Color  a,
Color  b 
)
inlinestatic

◆ RandomHue()

static Color ScottPlot.Color.RandomHue ( )
inlinestatic

◆ ToColor()

static System.Drawing.Color ScottPlot.Color.ToColor ( ScottPlot::Color  color)
inlinestatic

◆ ToHex()

string ScottPlot.Color.ToHex ( )
inline

return a string like "#6699AA" or "#6699AA42" if a semitransparent alpha is in use

◆ ToHSL()

float float float l ScottPlot.Color.ToHSL ( )
inline

◆ ToSDColor()

System.Drawing.Color ScottPlot.Color.ToSDColor ( )
inline

Create a System Drawing color.

◆ ToSKColor()

SkiaSharp.SKColor ScottPlot.Color.ToSKColor ( )
inline

Create a SkiaSharp color.

◆ ToString()

override string ScottPlot.Color.ToString ( )
inline

◆ ToStringRGB()

string ScottPlot.Color.ToStringRGB ( )
inline

return a string like "#6699AA"

◆ ToStringRGBA()

string ScottPlot.Color.ToStringRGBA ( )
inline

return a string like "#6699AAFF"

◆ WithAlpha() [1/2]

readonly Color ScottPlot.Color.WithAlpha ( byte  alpha)
inline

◆ WithAlpha() [2/2]

readonly Color ScottPlot.Color.WithAlpha ( double  alpha)

◆ WithBlue()

readonly Color ScottPlot.Color.WithBlue ( byte  blue)

◆ WithGreen()

readonly Color ScottPlot.Color.WithGreen ( byte  green)

◆ WithLightness()

Color ScottPlot.Color.WithLightness ( float  lightness = ::5f)
inline

◆ WithOpacity()

readonly Color ScottPlot.Color.WithOpacity ( double  opacity = .5)

◆ WithRed()

readonly Color ScottPlot.Color.WithRed ( byte  red)

Member Data Documentation

◆ Alpha

readonly byte ScottPlot.Color.Alpha

◆ Blue

readonly byte ScottPlot.Color.Blue

◆ Green

readonly byte ScottPlot.Color.Green

◆ h

float ScottPlot.Color.h

Hue, Saturation, and Luminance (as fractions from 0 to 1)

◆ Red

readonly byte ScottPlot.Color.Red

◆ s

float float ScottPlot.Color.s

Property Documentation

◆ A

byte ScottPlot.Color.A
get

◆ ARGB

uint ScottPlot.Color.ARGB
get

◆ B

byte ScottPlot.Color.B
get

◆ G

byte ScottPlot.Color.G
get

◆ Hue

float ScottPlot.Color.Hue
get

Hue as a fraction from 0 to 1.

◆ Luminance

float ScottPlot.Color.Luminance
get

Luminance as a fraction from 0 to 1.

◆ PremultipliedARGB

uint ScottPlot.Color.PremultipliedARGB
get

◆ R

byte ScottPlot.Color.R
get

◆ Saturation

float ScottPlot.Color.Saturation
get

Saturation as a fraction from 0 to 1.


The documentation for this struct was generated from the following file: