Sounds painful to program, honestly (depending on the number of components and how they 'change' over generations)
Well, let's do a quick (and bare bones) genetics lesson!
All genes in plants and animals have two alleles; one from each parent. There are a few different kinds of alleles and allelic interactions. The different kinds of alleles and blendings include:
1. Dominant alleles: An allele that always expresses itself in a gene. (Assuming red is dominant, red rose + blue rose = red rose)
2. Recessive alleles: Only expresses itself in the presence of another recessive allele.(Blue is recessive, so blue rose + blue rose= blue rose, but blue rose + red rose = red rose)
3. Codominant: Two recessive alleles interacting to create a blended phenotype (Assuming coloration is homozygous recessive or homozygous dominant, Red roses+Blue roses = purple roses)
Codominance can be seen when you observe someone with wavy hair(curly hair + straight hair) and occasionally in flowers like snapdragons. It's rare irl, but cross pollinating flowers is more fun when you just have codominant mixes.
When an egg is fertilized, one allele for each gene is present in the egg and sperm cell. To illustrate the possible resulting genotypes and odds, a Punnett square is used. Let's assume we have two heterozygous roses(Rr). (On the top and left sides of the table, the genotypes of the parents are shown)
Genotypically(for this punnett square), there is a 50% chance of the offspring being heterozygous, 25% chance of it being homozygous recessive, and 25% chance of it being homozygous recessive. PHENOTYPICALLY, there is a 75% chance of the offspring being red(R Phenotype) and a 25% chance of it being blue(r phenotype).
Now that Genetics class is over, we can get back to the important stuff. Dominance can be a boolean(denoting dominance or recessiveness), and each allele can be a value or set of values. Let's say snapdragons are in the game. There would be white, red, and yellow alleles. All color alleles are recessive, so white+red=pink, yellow+red=orange, and white+yellow=light yellow).
The most comprehensive approach for codominance in color would be to take the mean of the values for hue, brightness, and saturation when expressing codominant alleles in a gene. The most important thing here to note is that there are no new alleles being created. Orange snapdragons don't have orange alleles. To determine which allele is passed on from each parent... For each gene, RNG between 1 and 2; pass parent A's allele accordingly, then RNG for parent B's allele. The passed on alleles are then 'expressed' for the dominant allele, or two matching recessive alleles, or a codominant trait.
As for dominance and recessiveness, they're great for straight up booleans. If there is a cold resistance allele, it is going to work the same if it is heterozygous or homozygous(as long as it's expressed). Of course, I'm oversimplifying it, but you get the idea.