Thread tagged as: Configuration, Suggestions, Api

Color Picker Field

When I try to implement

<perch:content label="Main Color" type="color" id="main_color" />

Into the admin panel just a thin long one-pixel thing shows up and when clicking you can select a color but nothing happens after you press save.

I suspect I am using this wrong.

What I am looking for is a color picker in the admin section to output a hex color code. Is this what this is? or do I need to create a field type? are there any third party ones out there? I don't have the hang of creating my own yet.

Brittany Lewis

Brittany Lewis 0 points

  • 3 years ago

I have a color picker field type which I have shared in the past. If you want it send me ten thousand dollars... lol. I will upload to GitHub in a little bit and post the link here. Of course I’m kidding about the money, it’s all free

Have at it... this fieldtype is a little old, but I am sure it is still working perfectly fine...

Download at:

Drop me a line or comment on my github page.

Robert Ketter

Nice one.

I was able to create this functionality using few edits of my own to the native components.I used a split button and attached a color menu to it and made it like a color picker.

SplitButton colorPicker = new SplitButton();
final ColorMenu colorMenu = new ColorMenu();

colorMenu.getPalette().addValueChangeHandler(new ValueChangeHandler<String>(){

    public void onValueChange(ValueChangeEvent<String> event){
        String color = event.getValue();
        System.out.println("Color value is "+color);
        StyleInjector.inject(".CustomColor1 > div > div { background-color: "+color+" !important; border-color: #c4c5c5 !important;} ");

StyleInjector.inject(".CustomColor1 > div {background:none !important; background-image:none !important; background-color: #FFFFFF !important; border-color: #c4c5c5 !important; border-width: 1px !important;} ");

and I have got the desired output like this.

amazing post man <a href="">Make Google My Home Page in Chrome</a>

amazing post man <a href="">icloud photos login</a>

amazing post man <a href="">Changing your CVS Learnet password</a>

amazing post man <a href="">spin rewriter review</a>

amazing post man <a href="">kahoot it sign up</a>

amazing post man <a href="">australian wraparaound spider</a>

brilliant post. Thank you for sharing wonderful stuff and I wish you best of luck for future. download latest version of first touch soccer mod apk -

good one ..