Color wheel Picker cursor
up vote
2
down vote
favorite
Well, so I've created a Hue Color Wheel which looks like beneath:
What i want to achieve is a little white circle on top of this, which changes position when you hover (or drag) your cursor over the circle. Any ideas?
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
javascript colors cursor picker
add a comment |
up vote
2
down vote
favorite
Well, so I've created a Hue Color Wheel which looks like beneath:
What i want to achieve is a little white circle on top of this, which changes position when you hover (or drag) your cursor over the circle. Any ideas?
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
javascript colors cursor picker
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Well, so I've created a Hue Color Wheel which looks like beneath:
What i want to achieve is a little white circle on top of this, which changes position when you hover (or drag) your cursor over the circle. Any ideas?
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
javascript colors cursor picker
Well, so I've created a Hue Color Wheel which looks like beneath:
What i want to achieve is a little white circle on top of this, which changes position when you hover (or drag) your cursor over the circle. Any ideas?
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
for (var i=0; i<360; i++) {
var color = document.createElement("span")
color.setAttribute("id", "d" + i)
color.style.backgroundColor = "hsl(" + i + ", 100%, 50%)"
color.style.msTransform = "rotate(" + i + "deg)"
color.style.webkitTransform = "rotate(" + i + "deg)"
color.style.MozTransform = "rotate(" + i + "deg)"
color.style.OTransform = "rotate(" + i + "deg)"
color.style.transform = "rotate(" + i + "deg)"
document.getElementById('colorwheel').appendChild(color)
};
html, body {
margin: 0;
padding: 0;
min-height: 100%;
background: linear-gradient(#111, #222);
background: -webkit-linear-gradient(#111, #222);
background: -moz-linear-gradient(#111, #222);
background: -o-linear-gradient(#111, #222);
}
#colorwheel {
margin: 20px auto;
position: relative;
width: 640px;
height: 640px;
}
span {
cursor: wait;
position: absolute;
top: 310px;
left: 420px;
width: 15px;
height: 20px;
-ms-transform-origin: -100px 50%;
-webkit-transform-origin: -100px 50%;
-moz-transform-origin: -100px 50%;
-o-transform-origin: -100px 50%;
transform-origin: -100px 50%;
opacity: .1;
}
span:hover, span:active {
opacity: 1;
border-top-right-radius: 100%;
border-bottom-right-radius: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="colorwheel"></div>
javascript colors cursor picker
javascript colors cursor picker
edited Nov 9 at 22:19
tk421
3,33031426
3,33031426
asked Oct 8 at 14:10
![](https://lh3.googleusercontent.com/-nVn_csAPn-A/AAAAAAAAAAI/AAAAAAAAAAA/AAN31DVAwOVHu4CD6hjzJRNnbasNcxQdkw/mo/photo.jpg?sz=32)
![](https://lh3.googleusercontent.com/-nVn_csAPn-A/AAAAAAAAAAI/AAAAAAAAAAA/AAN31DVAwOVHu4CD6hjzJRNnbasNcxQdkw/mo/photo.jpg?sz=32)
Markowe Wyprzedaże
111
111
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52704160%2fcolor-wheel-picker-cursor%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown