earthbound19 / _ebDev

Various tools, mostly custom-made for art development.
2 stars 2 forks source link

support comments for .hexplt files in all scripts that use them #128

Open earthbound19 opened 2 years ago

earthbound19 commented 2 years ago

I added comments to some .hexplt files in _ebPalettes, and have begun to support this in scripts, but just found that it breaks BWsvgRandomColorFill.sh. (A created array contains comments.) All these scripts have paletteFile variables that may also be candidates for fixing:

BWsvgRandomColorFill.sh
color_growth_hexplts_multiColor_Ntimes.sh
color_growth_hexplt_multiColor.sh
findPalette.sh
hexplt2ppm.sh
hexplt2ppmHEX.sh
hexplt2rgbplt.sh
renderHexPalette.sh
rgbplt2hexplt.sh
color_growth_hexplt.sh
palette_combinatronics.py

The fix for bash scripts is to grep the hex RGB pattern; see renderHexPalette.sh:

# get array of colors from file by extracting all matches of a pattern of six hex digits preceded by a #:
colorsArray=( $(grep -i -o '#[0-9a-f]\{6\}' $hexPaletteFileName | tr -d '#') )
earthbound19 commented 2 years ago

keep comments in palette sort with rgbHexColorSortInOkLab.js

earthbound19 commented 2 years ago

to do: update list in OP to include any new scripts made since it

earthbound19 commented 1 year ago

fixed in getN_hexplt_shadesXchromas_Oklab.sh