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

Viewer: add clear-color attribute #15752

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

ryantrem
Copy link
Member

This change adds a clear-color attribute to the Viewer html element. Since it is in the html layer, it relies on WebAPI to convert an arbitrary color string to a Babylon Color4. It is transparent by default. I also made one other small change to have the root div (:host in css) inherit all from the outer babylon-viewer element. I think this should be safe, and it lets you do things like this in CSS:

babylon-viewer {
  background-image: url("https://raw.githubusercontent.com/BabylonJS/Assets/master/textures/Checker_albedo.png");
}

Combining these two things together, with the default transparent clear-color you can get this:

image

@ryantrem ryantrem requested a review from bghgary October 29, 2024 22:26
@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

@ryantrem ryantrem enabled auto-merge (squash) October 29, 2024 22:43
@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2024

@ryantrem ryantrem merged commit ab5cb82 into BabylonJS:master Oct 29, 2024
12 checks passed
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