Long ago I discovered that when it comes to averaging or mixing colours in code, it works better when you use one of the colour spaces like CIELab that model colour perception rather than the RGB signal strengths used in colour production. Björn Ottosson is an indie developer whose OKLch and OKLab colour-space definitions have rapidly become standard in web browsers and editors. Here’s a blog post where he discusses creating colour-picker UIs using variations on the OKLab system.
