posted an update —

local colour matching :

    /** Golden, earthy, sunlit. Positive b throughout. */
    private val WARM_ANCHORS = listOf(
        LabColor(45f, 30f, 35f),   // rust
        LabColor(70f, 8f, 55f),    // mustard
        LabColor(45f, -8f, 25f),   // olive
        LabColor(88f, 2f, 14f),    // cream
        LabColor(32f, 12f, 20f),   // chocolate
        LabColor(66f, 32f, 24f),   // coral
        LabColor(40f, -20f, 22f),  // moss
        LabColor(58f, 18f, 30f)    // caramel
    )

    /** Blue-based, cool, jewel-toned. Mostly negative b. */
    private val COOL_ANCHORS = listOf(
        LabColor(28f, 3f, -24f),   // navy
        LabColor(46f, -32f, 12f),  // emerald
        LabColor(32f, 30f, 0f),    // berry
        LabColor(94f, 0f, -2f),    // optic white
        LabColor(35f, 0f, -3f),    // charcoal
        LabColor(62f, 12f, -18f),  // lavender
        LabColor(52f, -22f, -6f),  // teal
        LabColor(45f, 2f, -35f)    // true blue
    )

    /** Muted and low-chroma — the tones that read as neither warm nor cool. */
    private val NEUTRAL_ANCHORS = listOf(
        LabColor(34f, 2f, -16f),   // soft navy
        LabColor(60f, 4f, 10f),    // taupe
        LabColor(64f, -12f, 12f),  // sage
        LabColor(92f, 0f, 4f),     // soft white
        LabColor(45f, -2f, -6f),   // slate
        LabColor(60f, 18f, 8f),    // dusty rose
        LabColor(30f, 4f, 6f),     // espresso
        LabColor(72f, -6f, 2f)     // stone
    )

    /**
     * The set of anchor colours that suit this person.
     *
     * Undertone picks the family; Fitzpatrick tunes it. These are hand-picked constants
     * rather than anything generated — colour analysis is a matter of taste, and taste
     * is easier to argue with when it is written down as eight literal values.
     */
    fun buildPalette(reading: SkinReading): Palette {
        val base = when (reading.undertone) {
            Undertone.WARM -> WARM_ANCHORS
            Undertone.COOL -> COOL_ANCHORS
            Undertone.NEUTRAL -> NEUTRAL_ANCHORS
        }

        return Palette(
            anchors = base.map { forFitzpatrick(it, reading.fitzpatrick) },
            undertone = reading.undertone
        )
    }

Log in or sign up for Devpost to join the conversation.