I use standard digit ColorPalette in my widget. It is simple tool and it works fine.
But I need to expand it with transparent or none color. I can deal with it in few ways:
- Add just a button near the Palette to clear the color
- Copy all code from
dijit/ColorPaletteto make custom Palette in my module - Extend the
dijit/ColorPalettein my module only by onenonecolor (preferable way)
Please point me how to extend dijit/ColorPalette or another way to implement <set_none_color> action if simple extending is imposible.
I'm newbie in Dojo and i want to deal with it in right way.
I have solved the problem by extending
dijit/ColorPalette(make subclass). I added basic functionality that I want. In general I did following:onChangeto blend color & alpha channels and return CSS value of color, also addonChangeCssto monitor changes in my module.The code is quite simple and efficient (this is basic example which can be improved)