json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

Color picker for colors with enumerated values

Open jdorn opened this issue 11 years ago • 4 comments

{
  "type": "string",
  "format": "color",
  "enum": ["#0000ff","#ff0000","#00ff00"]
}

This should render as a radio group with the colors shown in small squares.

jdorn avatar Jan 14 '14 18:01 jdorn

It would be nice to integrate spectrum.js and this feature is what you want http://bgrins.github.io/spectrum/#options-showPalette

j123b567 avatar Jan 04 '16 17:01 j123b567

Incidentally I've used Spectrum with json-editor myself and demonstrated it here:

https://github.com/TrevorPage/jdorn-json-editor-android

This demonstration is for Android and in my situation I absolutely had to use Spectrum because the Android browser's native colour picker doesn't seem to work.

I'm afraid I've not done any integration with the json-editor library as such. I'm just using jQuery to substitute in Spectrum in place of selected text fields, after json-editor has rendered its HTML.

TrevorPage avatar Jan 04 '16 17:01 TrevorPage

I create a spectrum-editor ^_^: https://github.com/hellobugme/json-editor.zh-CN/tree/master/plugin/spectrum-editor

hellobugme avatar Oct 05 '17 12:10 hellobugme

@hellobugme – this is awesome!

roypardi avatar Apr 03 '18 23:04 roypardi