Skip to content

Conversation

Ashish050488
Copy link
Contributor

Description of change

Fixes #10162

This PR adds a developer-facing warning when a transparent background color (like 'rgba(255, 0, 0, 0.5)') is set after the canvas has been initialized with backgroundAlpha: 1 (i.e., opaque).

Browsers do not allow changing the canvas alpha setting after initialization. This silent behavior has confused many developers.

✅ This PR includes:

  • A warn() message wrapped in #if _DEBUG so it’s dev-only
  • An updated JSDoc comment for backgroundAlpha explaining that the alpha must be set at initialization time
  • Clean code style consistent with PixiJS standards

This was previously merged into my fork by mistake — resubmitting here for the official PixiJS dev branch.


Pre-Merge Checklist
  • Tests and/or benchmarks are included (N/A for dev-only warning)
  • Documentation is changed or added (JSDoc for backgroundAlpha)
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Copy link

codesandbox-ci bot commented Jul 3, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6af681c:

Sandbox Source
pixi.js-sandbox Configuration

Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Jul 3, 2025
@Zyie Zyie added this pull request to the merge queue Jul 3, 2025
Merged via the queue into pixijs:dev with commit 23dca4b Jul 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Transparent Background doesn't work
3 participants