The real palette check: each asset reports its dominant color as a hex value, and you measure how far that sits from the nearest kit color. Distance metric: convert both hexes to RGB and take the largest absolute per-channel difference (so a color that matches red and green but misses blue by 100 is distance 100, not an average that hides it).
Color-science footnote: this is not perceptual distance — the studio-grade metric is Delta E in LAB space. Max-channel RGB is the cheap disqualifier: crude, fast, and plenty to catch a rogue purple.
Write two functions:
channel_distance(h1, h2)— max ofabs(a - b)across the three channels (hex_to_rgbis provided).nearest_brand_color(dominant)— returns(distance, name)for the closest color inPALETTE.
An asset is on-brand when the distance is 32 or less. The harness prints the verdicts. Expected output:
B01: on-brand (d=4, nearest=terracotta)
B02: off-brand (d=81, nearest=deep teal)
B03: on-brand (d=7, nearest=deep teal)
B04: off-brand (d=126, nearest=terracotta)