Skip to content

Conversation

@sawaisinghh
Copy link
Contributor

@sawaisinghh sawaisinghh commented Mar 5, 2023

Resolves #6006

Changes:
Document parameters of p5.Color constructor

PR Checklist

@welcome
Copy link

welcome bot commented Mar 5, 2023

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this! Everything looks pretty good, I just have two minor comments. Let me know if I can clarify anything!

* conversion that has already been performed.
*
* <a href="#/p5/color">color()</a> is the recommended way to create an instance
* of this class. But, if we use constructor then, it is required to use parameters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be slightly clearer if, instead of "But, if we use constructor then, it is required to use parameters," we instead something like, "However, one can also create a color instace from the constructor using the parameters below."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good suggestion

* @constructor
* @param {p5} [pInst] pointer to p5 instance.
*
* @param {p5.color|Number[]|String} vals an array or object containing the color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the _parseInputs function in the constructor doesn't handle a p5.Color, so I think the type here can just be Number[]|String. We can then also take out the "or object" part from the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will correct it.

@sawaisinghh sawaisinghh requested a review from davepagurek March 5, 2023 03:10
Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes, looks great!

@davepagurek
Copy link
Contributor

Looks like the linting test failed because there are trailing spaces, I'll just remove those

@davepagurek davepagurek merged commit d8d6f4f into processing:main Mar 5, 2023
@davepagurek
Copy link
Contributor

@all-contributors please add @sawaisinghh for docs

@allcontributors
Copy link
Contributor

@davepagurek

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token , in JSON at position 100743

@davepagurek
Copy link
Contributor

@all-contributors please add @sawaisinghh for documentation

@allcontributors
Copy link
Contributor

@davepagurek

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 101008

@davepagurek
Copy link
Contributor

@all-contributors please add @sawaisinghh for documentation

@allcontributors
Copy link
Contributor

@davepagurek

I've put up a pull request to add @sawaisinghh! 🎉

@davepagurek
Copy link
Contributor

(sorry for the noise! had to fix some json issues before it'd work.)

@sawaisinghh sawaisinghh deleted the sawaisinghh-document-parameteres branch March 5, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document parameters of p5.Color constructor

2 participants