Is there any way to add angular gradient to jQuery knob plugin, so that it starts from one color and along the arc, changes into another?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I digged the internet for a solution but no one ever tried this or posted a solution. Finally I am posting a Q&A. If anyone has a better solution, please share with us.
During the initialization, I have overridden the draw method and checked for the attribute shaded=”true”. If it’s there, then a gradient is formed, starting from white and moving towards fgColor. To chose starting color other than white, set the attribute shadeColor=”#(color hex code)”.
It draws a separate arc for each degree (with arc angle of 2 degrees instead of one for the sake of smoothness). The colors of arcs go through a transition from fgColor to shadeColor.
The color mixing effect is like paint mixing rather than light mixing, so if you start from green and go towards red, you won’t get the yellow shade in the center. It would look cool with light mixing effect but don’t know how to do that exactly. Also it is not a well optimized code, it’s just a solution. Huge room for improvement..