Natural gene / phase 1

Extension

Can this horse make black pigment at all? E says yes and does nothing. ee restricts black to zero everywhere, and the horse is a chestnut. It is the first gene in naturalOrder() because it decides which pigment the rest of the pipeline has to work with.

Crossing two of them

What it does

E_ — the horse can make eumelanin. No coat effect at all; isVisible returns false, so the gene is skipped entirely.

ee — black is set to 0 on every texel. Only red pheomelanin survives, so every subsequent gene samples the gradient’s left edge and the horse is a chestnut.

common/genetics/genes/ExtensionGene.java
@Override
public PigmentField restrict(AllelePair pair, CoatBuildContext ctx, PigmentView coat) {
    if (!isChestnut(pair)) {
        return null;
    }
    PigmentField f = coat.mutableCopy();
    CoatRegions.restrictAll(ctx.skin(), f, (field, px, py, p) -> field.setBlack(px, py, 0f));
    return f;
}

Its gene carrot

Gene key
horsegenetics.extension
Alleles
E e
Outcomes
wild, chestnut
Shows when
e/e
Default allele
E
Wild frequency
50/50 per allele
Founder draws
1 × nextFloat()
Deterministic
yes

Interactions

  • Agouti is invisible on a chestnut. Bay is a restriction of black to the points; with no black to restrict there is nothing to see. AgoutiGene.isVisible checks genotype.hasBlackPigment() for exactly this reason — and that is a real-world behaviour, not a shortcut: a chestnut can carry A invisibly for generations.
  • Dilutions read what is left. Champagne on a chestnut is gold champagne; cream on a chestnut is palomino, then cremello. All of that falls out of the dilutions sampling the current pigment rather than branching on a colour name.
  • Everything is invisible under dominant white.
Why this is the model, not a special case

Nothing anywhere in the pipeline says “if chestnut then …”. A chestnut is just a horse whose black channel is zero, and every later gene behaves correctly on it without knowing it exists. That is the payoff of the pigment-field design.

Not modelled

Real MC1R has a third allele, ea, phenotypically red like e. Adding it is purely additive now that multi-allele support exists — the interest is in the code string and the carrier display, not in a new look.

Source: common/genetics/genes/ExtensionGene.java