102 return new string[] {
"N",
"BandSize",
"Seed" };
135 throw new ScriptRuntimeException(
"N in RandomLinearAnalogousHSL(N[,BandSize]) has to be positive.", Node);
138 throw new ScriptRuntimeException(
"BandSize in RandomLinearAnalogousHSL(N[,BandSize]) has to be positive.", Node);
140 SKColor[] Result =
new SKColor[N];
146 int BandSize2 = BandSize / 2;
150 Generator =
new Random(Seed.Value);
156 H = Generator.NextDouble() * 360;
157 S = Generator.NextDouble();
158 L = Generator.NextDouble();
172 H += Generator.NextDouble() * 120 - 60;
173 S = Generator.NextDouble();
174 L = Generator.NextDouble();
190 for (j = 0; j < d; j++)
192 R = ((R2 * j) + (R1 * (BandSize - j)) + BandSize2) / BandSize;
193 G = ((G2 * j) + (G1 * (BandSize - j)) + BandSize2) / BandSize;
194 B = ((B2 * j) + (B1 * (BandSize - j)) + BandSize2) / BandSize;
205 Result[i++] =
new SKColor((
byte)R, (
byte)G, (
byte)B);
213 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.
static SKColor[] CreatePalette(int N, int BandSize, out int Seed, ScriptNode Node, Variables Variables)
TODO
static SKColor[] CreatePalette(int N, int BandSize, int? Seed, ScriptNode Node)
TODO
static SKColor[] CreatePalette(int N, int BandSize, ScriptNode Node)
TODO
RandomLinearAnalogousHSL(ScriptNode N, int Start, int Length, Expression Expression)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
override string FunctionName
TODO
override string[] DefaultArgumentNames
Default Argument names
RandomLinearAnalogousHSL(ScriptNode N, ScriptNode BandSize, int Start, int Length, Expression Expression)
TODO
RandomLinearAnalogousHSL(ScriptNode N, ScriptNode BandSize, ScriptNode Seed, int Start, int Length, Expression Expression)
TODO
static SKColor ToColorHSL(double H, double S, double L)
Creates a Color from its HSL 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.