I can just patch it, but better way is to fix the upstream.
declare module '../../index' {
class Color {
// TODO: Fix p5.Color() errors in src/color/p5.Color.js, line 318:
//
// required param "vals" follows an optional param
//
constructor(vals: number[]|string);
constructor(pInst: p5, vals: number[]|string);
overload it may solve the problem.
ref
/**
* @class p5.Color
* @constructor
* @param {p5} [pInst] pointer to p5 instance.
*
* @param {Number[]|String} vals an array containing the color values
* for red, green, blue and alpha channel
* or CSS color.
*/
p5.Color = class Color {
may change to
/**
* @class p5.Color
* @constructor
*
* @param {Number[]|String} vals an array containing the color values
* for red, green, blue and alpha channel
* or CSS color.
*/
/**
* @class p5.Color
* @constructor
* @param {p5} pInst pointer to p5 instance.
*
* @param {Number[]|String} vals an array containing the color values
* for red, green, blue and alpha channel
* or CSS color.
*/
p5.Color = class Color {
I can just patch it, but better way is to fix the upstream.
overload it may solve the problem.
ref
may change to