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

Render pass tracing now logs values used to clear color/depth/stencil buffer #7239

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 24, 2024

  • updated Color.toString to handle HDR colors as well by printing those as an array instead of #xxxxxx
  • use it for render pass clear values logging

* @returns {string} The color in string form.
* @example
* const c = new pc.Color(1, 1, 1);
* // Outputs #ffffffff
* console.log(c.toString());
*/
toString(alpha) {
let s = `#${((1 << 24) + (Math.round(this.r * 255) << 16) + (Math.round(this.g * 255) << 8) + Math.round(this.b * 255)).toString(16).slice(1)}`;
toString(alpha, asArray) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -226,24 +226,31 @@ class Color {
* is the same format as used in HTML/CSS.
*
* @param {boolean} alpha - If true, the output string will include the alpha value.
* @param {boolean} asArray - If true, the output will be an array of numbers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @param {boolean} asArray - If true, the output will be an array of numbers.
* @param {boolean} [asArray] - If true, the output will be an array of numbers. Defaults to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants