Skip to content

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

@earthbound19

Description

@earthbound19

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 '#') )

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - majorthis breaks essential functionality pls pls fix kthxbai

    Projects

    Status

    in progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions