Example for palettes.json?

I am trying to define custom palettes using the color picker. It seems that the default palettes are somewhere defined in the EYESY-code - so I did not manage to find an example for a corresponding JSON file.

Following the user manual I used the color picker, created a “palettes.json” file and after passing the duckduckgo JSON test I copied it to EYESY’s system folder. Here is the code:

{
“name”: “BBGY”,
“a”: [
0.5,
0.5,
0.49
],
“b”: [
-1.06,
1,
0.93
],
“c”: [
0.5,
0.52,
0.97
],
“d”: [
-0.17,
0.57,
0.67
]
}

Nevertheless I am getting the error message “Invalid structure or empty list in /usbdrive/System/palettes.json, using default palettes.”

Can somebody tell me what’s wrong with the file or post his/her palettes.json file? So I can learn what I am doing wrong.

Here’s an example of the palettes.json

[
{"name":"My Palette","a":[0.5,0.5,0.5],"b":[1,1,1],"c":[1,1,1],"d":[0,0.33,0.67]},
{"name":"Palette 2","a":[0.55,0.09,0.09],"b":[-0.75,-1.12,-1.46],"c":[5,4.03,2.71],"d":[0,0.33,0.67]}
]

It looks like you are missing a [ at the beginning and a ] at the end.

Great! That does the trick. Thank you for your support! :grinning_face:

I am wondering why the config.json does not need these brackets. I can only guess that EYESY always expects more than one palette definition in the palettes.json and therefore it needs an array syntax with [ and ]

Here’s the actual default_palette.json file in case you’re interested. See how it imports random at the beginning? The way I understand is that Eyesy uses that for the ‘special’ first palette listed which it handles differently than the rest of the palettes. It ranges from black and white to greys, then a sort of rainbow spectrum followed by randomized colors. It does things the regular palettes can’t do. If you’re curious you can check out my extended custom_palette.json that I use in the emulator I’ve been working on. (You place it in the system folder on the device and it will override the default palette, albeit the ‘magic’ Original palette I speak of above doesn’t work with this. The custom palette can’t do the “import random” trickery of the default palette.)

Hope this helps.

@turbulent_resonant Thank you for the detailed information. That was the original file that I was looking for. Meanwhile I managed to build a working palettes.json. Your files are an inspiration. The random trick is indeed interesting.

1 Like

And you know about the Palette Picker Page, I hope, right? (Say that ten times quickly.) It pairs nicely with this python format conversion code I think.

Yes, other than usual with new gear I read the EYESY user manual :blush: and used the Palette Picker Page. It really makes creating new palettes easy. Once a valid palettes.json file exists in the system folder it’s just copy paste from the palette picker

BTW: I have some trouble with your emulator as some modules are missing in my (Ubuntu)-Python3 installation. Tried to fix it but I need to dig a little bit deeper and decided to put further investigations on hold for now. First let me learn a little bit more Python to get a better idea how to create custom modes.

Yeah. I need to make a guide I suppose. You should need numpy, sounddevice and possibly pygame libraries. They should be pretty easy to install from the command line but I appreciate the feedback. Let me know if you have any further difficulty. Also you should check out this ChatGPT trained on writing Eyesy mode code. It’s been invaluable to me. As well as infuriating.