/*
* @title UnionDrawのペンの色を変えるブックマークレット
* @description http://unionplatform.com/samples/orbitermicro/UnionDraw/uniondraw.html で実行してみて。
* @include http://unionplatform.com/samples/orbitermicro/UnionDraw/uniondraw.html
* @license MIT License
* @require
*/
(function(){
var _colorChange = function (rgb) {
// Determine which option was selected
var newColor = rgb;
// Locally, set the line color to the selected value
localLineColor = newColor;
// Share selected color with other users
msgManager.sendUPC(UPC.SET_CLIENT_ATTR,
orbiter.getClientID(),
"",
Attributes.COLOR,
newColor,
roomID,
"4");
// Scroll the iPhone back to the top-left.
iPhoneToTop();
};
(function() {
var xs = ['00','11','22','33','44','55','66','77','88','99','aa','bb','cc','dd','ee','ff'];
var r = xs[Math.random() * xs.length | 0];
var g = xs[Math.random() * xs.length | 0];
var b = xs[Math.random() * xs.length | 0];
var rgb = '#' + r + g + b;
document.getElementById('color')[1].innerText = rgb;
_colorChange(rgb);
setTimeout(arguments.callee, 100) ;
})();
})();