Godot App Pallette Parser #66

Closed
opened 2019-03-07 04:01:02 +00:00 by Squatnet · 0 comments
Squatnet commented 2019-03-07 04:01:02 +00:00 (Migrated from github.com)

I created a script to parse pallettes into the app exactly as they would be expected to be written for FastLEDS. on its first run the app detects that it doesnt know any pallettes and opens a text file from the internal app storage. def_pallettes.txt it expects this file to contain pallettes written like this (note the semicolon after function definition closes, this is important)

DEFINE_GRADIENT_PALETTE( Pastel1_08_gp ) {//group 1
  0, 244, 118, 98,
  31, 244, 118, 98,
  31, 101, 157, 190,
  63, 101, 157, 190,
  63, 142, 213, 133,
  95, 142, 213, 133,
  95, 177, 154, 192,
  127, 177, 154, 192,
  127, 252, 178, 87,
  159, 252, 178, 87,
  159, 255, 255, 145,
  191, 255, 255, 145,
  191, 192, 176, 120,
  223, 192, 176, 120,
  223, 249, 180, 210,
  255, 249, 180, 210
};

it will parse them, (dropping the first column) and add them to its internal pallette dictionary (basically converts them to JSON) with its name.
new pallettes can be added by creating a file in the user data directory called user_pallettes.txt which is written in exactly the same way. pallettes with names which match an existing pallette will replace the exisiting pallette. the file is parsed by clicking the button in settings to parse pallettes ( you will need to reload an open device once new pallettes are parsed )

I created a script to parse pallettes into the app exactly as they would be expected to be written for FastLEDS. on its first run the app detects that it doesnt know any pallettes and opens a text file from the internal app storage. `def_pallettes.txt` it expects this file to contain pallettes written like this (note the semicolon after function definition closes, this is important) ``` DEFINE_GRADIENT_PALETTE( Pastel1_08_gp ) {//group 1 0, 244, 118, 98, 31, 244, 118, 98, 31, 101, 157, 190, 63, 101, 157, 190, 63, 142, 213, 133, 95, 142, 213, 133, 95, 177, 154, 192, 127, 177, 154, 192, 127, 252, 178, 87, 159, 252, 178, 87, 159, 255, 255, 145, 191, 255, 255, 145, 191, 192, 176, 120, 223, 192, 176, 120, 223, 249, 180, 210, 255, 249, 180, 210 }; ``` it will parse them, (dropping the first column) and add them to its internal pallette dictionary (basically converts them to JSON) with its name. new pallettes can be added by creating a file in the user data directory called `user_pallettes.txt` which is written in exactly the same way. pallettes with names which match an existing pallette will replace the exisiting pallette. the file is parsed by clicking the button in settings to parse pallettes ( you will need to reload an open device once new pallettes are parsed )
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
squatnet/ArduinoStuff#66
No description provided.