#!/bin/bash
# Koldflux brand-colour contrast test: run in an empty folder with this script's siblings (wcag.py, measure.py, colors.tsv, contrast-test.py, tool_check.cjs, verify-fixed.py).
set -e
export PATH=$HOME/.nvm/versions/node/v24.21.0/bin:$PATH
cd "$(dirname "$0")"
node tool_check.cjs tool-colors.json $(cut -f2 colors.tsv | tr '\n' ' ') "#000000" "#FFFFFF"
python3 contrast-test.py ./work tool-colors.json
node tool_check.cjs tool-fixed.json $(python3 -c "import json;print(' '.join(json.load(open('work/fixed.json')).values()))")
python3 verify-fixed.py tool-fixed.json work/fixed.json
