Speaking to smoke – I can only extend already my provided link in comment (or Zargul's answer) by more screens ...
For Domain object type in Color Attribute field color
... or use Atribute node if you are not using Principled Volume node.
For each smoke emitter (Cube) change under Physics Properties > Fluid > Smoke Color
I'm not sure if there is a way to mix flames inside one domain. From provided image (where flames seems to be in just vertical direction without touch), you can fake it by masking half of domain for flames data and merge them back together in single material.
Since this is a fake ... don't let flames pass a center of the domain ... It will break the illusion ;)
Note: Not directly suggested ... but once I tried to use multiple domains https://vimeo.com/manage/videos/246353861 that worked surprisingly well :) Tested especially for a long smoke trials where you quickly loose resolution since domain resolution is based on number of divisions along longest side of domain. So in some specific smoke trails it was impossible to reach such result.