-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
added documentation to _getBrightness() and _getGreen() function #7908
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
base: dev-2.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor typos @FerrinThreatt - otherwise looking good!
Adding documentation steward @perminder-17 - these are some new docs on the private functions, but please add any feedback, or feel free merge when it seems ready to you!
/** | ||
* This function extracts the green value from a color object, returns green | ||
* value in the range of 0 to 255 by default. When colorMode() is set to an | ||
* RBG value, the green value within the givin range is returned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - typo: "given"
/** | ||
* Brightness obtains the HSB brightness value from either a p5.Color object, | ||
* an array of color components, or a CSS color string.Depending on value, | ||
* when colorMode() is set a HSB value, this function will returns the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor - typo: "will return" (sing.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, just some minor suggestions. :)
@@ -546,6 +546,11 @@ class Color { | |||
} | |||
} | |||
|
|||
/** | |||
* This function extracts the green value from a color object, returns green | |||
* value in the range of 0 to 255 by default. When colorMode() is set to an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* value in the range of 0 to 255 by default. When colorMode() is set to an | |
* value in the range of 0 to 255 by default. When `colorMode()` is set to an |
/** | ||
* This function extracts the green value from a color object, returns green | ||
* value in the range of 0 to 255 by default. When colorMode() is set to an | ||
* RBG value, the green value within the givin range is returned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* RBG value, the green value within the givin range is returned | |
* RBG value, the green value within the givin range is returned. |
@@ -625,6 +630,13 @@ class Color { | |||
return map(to(this._color, 'hsl').coords[1], colorjsMax[0], colorjsMax[1], max[0], max[1]); | |||
} | |||
} | |||
/** | |||
* Brightness obtains the HSB brightness value from either a p5.Color object, | |||
* an array of color components, or a CSS color string.Depending on value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* an array of color components, or a CSS color string.Depending on value, | |
* an array of color components, or a CSS color string. Depending on value, |
/** | ||
* Brightness obtains the HSB brightness value from either a p5.Color object, | ||
* an array of color components, or a CSS color string.Depending on value, | ||
* when colorMode() is set a HSB value, this function will returns the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* when colorMode() is set a HSB value, this function will returns the | |
* when `colorMode()` is set to HSB, this function will returns the |
@@ -546,6 +546,11 @@ class Color { | |||
} | |||
} | |||
|
|||
/** | |||
* This function extracts the green value from a color object, returns green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rephrase it to something like : "from a color object and returns it in the range 0–255 by default."
* Brightness obtains the HSB brightness value from either a p5.Color object, | ||
* an array of color components, or a CSS color string.Depending on value, | ||
* when colorMode() is set a HSB value, this function will returns the | ||
* brightness value in the range. By default, this function will return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* brightness value in the range. By default, this function will return | |
* brightness value within the current range. By default, this function will return |
* an array of color components, or a CSS color string.Depending on value, | ||
* when colorMode() is set a HSB value, this function will returns the | ||
* brightness value in the range. By default, this function will return | ||
* the HSB brightness within the range 0 - 100. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* the HSB brightness within the range 0 - 100. | |
* the HSB brightness within the range 0–100. |
addresses #6971
Changes:
added documentation to _getBrightness() and _getGreen() functions
PR Checklist
npm run lint
passes