Calculating Colors in CSS and Twig with Craft's Color Field

Calculating proper contrast between background and text color using CSS calc(), the Craft color field, and some help from others.

Craft 3, Craft 4

CSS