Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple device orientation to RGB color
<title>Device Orientation</title>
<script src=""></script>
function handleOrientation(orientData) {
var color = d3.rgb(orientData.alpha, orientData.beta, orientData.gamma)"html").style("background", color);
window.addEventListener("deviceorientation", handleOrientation, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.