100 return new string[] {
"N",
"BandSize",
"Seed" };
118 throw new ScriptRuntimeException(
"N in RandomLinearAnalogousHSV(N[,BandSize]) has to be positive.", Node);
121 throw new ScriptRuntimeException(
"BandSize in RandomLinearAnalogousHSV(N[,BandSize]) has to be positive.", Node);
123 SKColor[] Result =
new SKColor[N];
129 int BandSize2 = BandSize / 2;
133 Generator =
new Random(Seed.Value);
139 H = Generator.NextDouble() * 360;
140 S = Generator.NextDouble();
141 V = Generator.NextDouble();
155 H += Generator.NextDouble() * 120 - 60;
156 S = Generator.NextDouble();
157 V = Generator.NextDouble();
173 for (j = 0; j < d; j++)
175 R = ((R2 * j) + (R1 * (BandSize - j)) + BandSize2) / BandSize;
176 G = ((G2 * j) + (G1 * (BandSize - j)) + BandSize2) / BandSize;
177 B = ((B2 * j) + (B1 * (BandSize - j)) + BandSize2) / BandSize;
188 Result[i++] =
new SKColor((
byte)R, (
byte)G, (
byte)B);
196 private static readonly Random gen =
new Random();
Script runtime exception.
Class managing a script expression.
static double ToDouble(object Object)
Converts an object to a double value.
Calculates a palette of random color bands.
override string[] DefaultArgumentNames
Default Argument names
static SKColor[] CreatePalette(int N, int BandSize, int? Seed, ScriptNode Node)
TODO
RandomLinearAnalogousHSV(ScriptNode N, ScriptNode BandSize, ScriptNode Seed, int Start, int Length, Expression Expression)
TODO
static SKColor[] CreatePalette(int N, int BandSize, ScriptNode Node)
TODO
override string FunctionName
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
RandomLinearAnalogousHSV(ScriptNode N, int Start, int Length, Expression Expression)
TODO
RandomLinearAnalogousHSV(ScriptNode N, ScriptNode BandSize, int Start, int Length, Expression Expression)
TODO
static SKColor ToColorHSV(double H, double S, double V)
Creates a Color from its HSV representation.
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
static readonly ArgumentType[] argumentTypes2Scalar
Two scalar parameters.
static readonly ArgumentType[] argumentTypes3Scalar
Three scalar parameters.
static readonly ArgumentType[] argumentTypes1Scalar
One scalar parameter.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
TextWriter ConsoleOut
Console out interface. Can be used by functions and script to output data to the console.
Basic interface for all types of elements.