Select color of filter effects


(strmiska) #1

i use hypes filter-effect for a color-slider. by clicking the circle the just selected color should be selected.
it works with “element.style.backgroundColor” simply javascript. but then only the first set color is selected,
not the color, where the slider stops.
“setProperty” also doesn´t work.
is there a special javascript-tag to check the color out of the filter-effects?
colorShapeSlider.hype.zip (19,7 KB)


(Mark Hunte) #2

The issue you are having is you are not changing the background colour.

You are changing the hue.

What you can do is change the filter which has the hue attribute inside of the element also. You may find a cross browser way but tested in my Safari, Chrome and FF.

element.style.backgroundColor = malen.style.backgroundColor; 
element.style.filter = malen.style.filter;

(strmiska) #3

great! thank you @MarkHunte! didn´t know i can use “.filter” - till now. :wink: