-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Changes from 1 commit
a8bfec6
d3e898c
8677f2b
6af5d3e
71379c3
00bbbd9
15999db
b606575
c205623
655667d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 | ||||||
FerrinThreatt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
* RBG value, the green value within the givin range is returned | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor - typo: "given"
FerrinThreatt marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
*/ | ||||||
_getGreen(max=[0, 1]) { | ||||||
if(!Array.isArray(max)){ | ||||||
max = [0, max]; | ||||||
|
@@ -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, | ||||||
FerrinThreatt marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
* when colorMode() is set a HSB value, this function will returns the | ||||||
|
* when colorMode() is set a HSB value, this function will returns the | |
* when `colorMode()` is set to HSB, 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.
We should rephrase it to something like : "from a color object and returns it in the range 0–255 by default."