96 return new string[] {
"N",
"BandSize",
"Seed" };
119 SKColor[] Result =
new SKColor[N];
124 int BandSize2 = BandSize / 2;
128 Generator =
new Random(Seed.Value);
134 R2 = Generator.Next(256);
135 G2 = Generator.Next(256);
136 B2 = Generator.Next(256);
145 R2 = Generator.Next(256);
146 G2 = Generator.Next(256);
147 B2 = Generator.Next(256);
158 for (j = 0; j < d; j++)
160 R = ((R2 * j) + (R1 * (BandSize - j)) + BandSize2) / BandSize;
161 G = ((G2 * j) + (G1 * (BandSize - j)) + BandSize2) / BandSize;
162 B = ((B2 * j) + (B1 * (BandSize - j)) + BandSize2) / BandSize;
173 Result[i++] =
new SKColor((
byte)R, (
byte)G, (
byte)B);
181 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
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
RandomLinearRGB(ScriptNode N, ScriptNode BandSize, int Start, int Length, Expression Expression)
TODO
override string FunctionName
TODO
static SKColor[] CreatePalette(int N, int BandSize, ScriptNode Node)
TODO
static SKColor[] CreatePalette(int N, int BandSize, int? Seed, ScriptNode Node)
TODO
RandomLinearRGB(ScriptNode N, ScriptNode BandSize, ScriptNode Seed, int Start, int Length, Expression Expression)
TODO
RandomLinearRGB(ScriptNode N, int Start, int Length, Expression Expression)
TODO
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.