You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using validateParameters function in error_helpers.js to do type check for parameters in function.
/**
* creates a directional light with a color and a direction
* @method directionalLight
* @param {Number|Array|String|p5.Color} v1 gray value,
* red or hue value (depending on the current color mode),
* or color Array, or CSS color string
* @param {Number} [v2] optional: green or saturation value
* @param {Number} [v3] optional: blue or brightness value
* @param {Number} [a] optional: opacity
* @param {Number|p5.Vector} x x axis direction or a p5.Vector
* @param {Number} [y] optional: y axis direction
* @param {Number} [z] optional: z axis direction
* @return {p5}
*/
p5.prototype.directionalLight = function(v1, v2, v3, a, x, y, z){//...}
This function takes a color and a direction as arguments, color could be any p5 color format and direction could be xyz or a p5.Vector
It turns out it has a problem with multiple types of the same parameter:
I ran into this too with another method and ended up having to comment out the whole parameter checking in that method. I wonder if given the experimental nature of this functionality, it's best to remove it for now until someone has the time to give it one more pass and get it in super good shape?
Hi, I am using
validateParameters
function in error_helpers.js to do type check for parameters in function.This function takes a color and a direction as arguments, color could be any p5 color format and direction could be xyz or a p5.Vector
It turns out it has a problem with multiple types of the same parameter:
Say we have
(1, 1, 1, 1)
as arguments, it satisfies situation 1, however, it still reports error of situation234.Can validateParameters support multiple-type parameter?
The text was updated successfully, but these errors were encountered: