101 return new string[] {
"N",
"BandSize",
"Seed" };
119 throw new ScriptRuntimeException(
"N in RandomLinearComplementaryHSV(N[,BandSize]) has to be positive.", Node);
122 throw new ScriptRuntimeException(
"BandSize in RandomLinearComplementaryHSV(N[,BandSize]) has to be positive.", Node);
124 SKColor[] Result =
new SKColor[N];
130 int BandSize2 = BandSize / 2;
134 Generator =
new Random(Seed.Value);
140 H = Generator.NextDouble() * 360;
141 S = Generator.NextDouble();
142 V = Generator.NextDouble();
156 H += Generator.NextDouble() * 120 + 120;
157 S = Generator.NextDouble();
158 V = Generator.NextDouble();
174 for (j = 0; j < d; j++)
176 R = ((R2 * j) + (R1 * (BandSize - j)) + BandSize2) / BandSize;
177 G = ((G2 * j) + (G1 * (BandSize - j)) + BandSize2) / BandSize;
178 B = ((B2 * j) + (B1 * (BandSize - j)) + BandSize2) / BandSize;
189 Result[i++] =
new SKColor((
byte)R, (
byte)G, (
byte)B);
197 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
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
static SKColor[] CreatePalette(int N, int BandSize, ScriptNode Node)
TODO
RandomLinearComplementaryHSV(ScriptNode N, ScriptNode BandSize, int Start, int Length, Expression Expression)
TODO
RandomLinearComplementaryHSV(ScriptNode N, ScriptNode BandSize, ScriptNode Seed, int Start, int Length, Expression Expression)
TODO
RandomLinearComplementaryHSV(ScriptNode N, int Start, int Length, Expression Expression)
TODO
override string FunctionName
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.