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
How to set text color Constraint according to background color. #21
Comments
Hi vikasinnoeye, <input type="text" id="color-input" />
<div id="box"></div> $('#color-input').on('slidermove', function() {
$('#box').css('background-color', $(this).wheelColorPicker('getValue', 'css'));
}); |
Hi @fujaru Thanks for replaying, can you please tell me how can I set set text color according to the background color like the example link? |
I am not sure what did you mean by "text color", but you can get the color value in hex (e.g. #ffffff) with $('#color-input').wheelColorPicker('getValue', 'css') Please refer to the example.html page for samples on how to assign colors and labels to other elements with the color picker. |
I see that. You can get the "brightness" ( $('#color-input').wheelColorPicker('getColor').v The value is between 0 to 1, we can check whether the value is more or less than, say, 0.5 to alter the color between black or white. |
Hi, for that looking into the issue but with above code: I am always getting value 1, can you please check that. |
Please check this video recording on result: https://streamable.com/1ctjq |
The v value refers to V component of HSV/HSB colorspace. In this case, we would need to convert it to HSL and use L component instead. https://stackoverflow.com/questions/3423214/convert-hsb-hsv-color-to-hsl |
Hi,
can you please tell me how can I implement functionality like this =>https://material.io/color/#!/?view.left=0&view.right=1&primary.color=c4e0a4&primary.text.color=d5ffca
I want to set background color of box and and auto set text according to background color automatically.
Can you please tell me is there any function of parameter in this plugin.
Thanks
The text was updated successfully, but these errors were encountered: