C# Class Sunny.UI.RandomColor

Generates random numbers.
显示文件 Open project: yhuse/SunnyUI

Public Methods

Method Description
GetColor ( ColorScheme scheme, Luminosity luminosity ) : Color

Gets a new random color.

GetColors ( ) : Color[]

Generate one color for each of the provided generator options.

GetColors ( ColorScheme scheme, Luminosity luminosity, int count ) : Color[]

Generates multiple random colors.

HsvToColor ( int hue, int saturation, double value ) : Color

Converts hue, saturation, and lightness to a color.

Seed ( ) : void

Reseeds the random number generated.

Seed ( int seed ) : void

Reseeds the random number generated.

Private Methods

Method Description
DefineColor ( ColorScheme scheme, Array hueRange, ].int[ lowerBounds ) : void
GetColorInfo ( int hue ) : DefinedColor
GetHueRange ( ColorScheme colorInput ) : Range
GetMinimumBrightness ( int H, int S ) : int
LoadColorBounds ( ) : void
PickBrightness ( int H, int S, Luminosity luminosity ) : int
PickHue ( ColorScheme scheme ) : int
PickSaturation ( int hue, Luminosity luminosity, ColorScheme scheme ) : int
RandomColor ( ) : System
RandomWithin ( Range range ) : int
RandomWithin ( int lower, int upper ) : int

Method Details

GetColor() public static method

Gets a new random color.
public static GetColor ( ColorScheme scheme, Luminosity luminosity ) : Color
scheme ColorScheme Which color schemed to use when generating the color.
luminosity Luminosity The desired luminosity of the color.
return Color

GetColors() public static method

Generate one color for each of the provided generator options.
public static GetColors ( ) : Color[]
return Color[]

GetColors() public static method

Generates multiple random colors.
public static GetColors ( ColorScheme scheme, Luminosity luminosity, int count ) : Color[]
scheme ColorScheme Which color schemed to use when generating the color.
luminosity Luminosity The desired luminosity of the color.
count int How many colors to generate
return Color[]

HsvToColor() public static method

Converts hue, saturation, and lightness to a color.
public static HsvToColor ( int hue, int saturation, double value ) : Color
hue int
saturation int
value double
return Color

Seed() public static method

Reseeds the random number generated.
public static Seed ( ) : void
return void

Seed() public static method

Reseeds the random number generated.
public static Seed ( int seed ) : void
seed int The number used to reseed the random number generator.
return void