-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add support for THREE.ColorManagement #123
Open
donmccurdy
wants to merge
8
commits into
georgealways:master
Choose a base branch
from
donmccurdy:feat/three-colormanagement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5491f7c
Add support for THREE.ColorManagement
donmccurdy f381f2c
Use getHex/setHex, not getRGB/setRGB
donmccurdy d92a26e
Clean up
donmccurdy 0b0e9b3
colorspace test case
georgealways 965acb4
fix test case
georgealways cdf618d
use call tracker in unit test
georgealways 5e00212
explain get/setHex in docs
georgealways 4c40ae4
formatting
georgealways File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as THREE from 'https://cdn.jsdelivr.net/npm/three/build/three.module.js'; | ||
import GUI from '../../dist/lil-gui.esm.js'; | ||
|
||
const debugDiv = document.getElementById( 'debug-div' ); | ||
|
||
const scene = new THREE.Scene(); | ||
|
||
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); | ||
camera.position.z = 2; | ||
|
||
const renderer = new THREE.WebGLRenderer(); | ||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
document.body.appendChild( renderer.domElement ); | ||
|
||
const geometry = new THREE.BoxGeometry(); | ||
const material = new THREE.MeshBasicMaterial( { color: 0x00aaff } ); | ||
const cube = new THREE.Mesh( geometry, material ); | ||
|
||
scene.add( cube ); | ||
const gui = new GUI(); | ||
const ctrl = gui.addColor( material, 'color' ); | ||
|
||
function animate() { | ||
|
||
requestAnimationFrame( animate ); | ||
|
||
cube.rotation.x += 0.01; | ||
cube.rotation.y += 0.01; | ||
|
||
debugDiv.style.backgroundColor = '#' + ctrl.$text.value; | ||
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. might want to delete this example before we merge, but here's what i was really after... |
||
|
||
renderer.render( scene, camera ); | ||
|
||
} | ||
|
||
animate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title></title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
canvas { | ||
display: block; | ||
} | ||
#debug-div { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 50%; | ||
height: 100%; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div id="debug-div"></div> | ||
<script type="module" src="custom-color.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this part of the Migrating section talks about how lil-gui allows you to forego the old
onChange
pattern from dat.gui. i'm thinking about changing this example to use a different lib with 0-1 RGB values (maybe PIXI?). this way we don't have to gloss over colorspaces.