Skip to content

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

Open
wants to merge 1 commit into
base: dev-2.0
Choose a base branch
from

Conversation

FerrinThreatt
Copy link

addresses #6971

Changes:
added documentation to _getBrightness() and _getGreen() functions

PR Checklist

Copy link
Member

@ksen0 ksen0 left a 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
Copy link
Member

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
Copy link
Member

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.)

Copy link
Collaborator

@perminder-17 perminder-17 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 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* the HSB brightness within the range 0 - 100.
* the HSB brightness within the range 0100.

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.

3 participants