Refactor to make more flexible. Update to use min color values
Separate function into separate file from demo data