Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: fix p5.Color constructor #111

Open
asukaminato0721 opened this issue Jul 13, 2023 · 0 comments
Open

TODO: fix p5.Color constructor #111

asukaminato0721 opened this issue Jul 13, 2023 · 0 comments
Labels
require upstream Need upstream to update

Comments

@asukaminato0721
Copy link
Contributor

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 {
@asukaminato0721 asukaminato0721 added the require upstream Need upstream to update label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
require upstream Need upstream to update
Projects
None yet
Development

No branches or pull requests

1 participant