~

Monochrome Achievement

How we detect gifts where model blends with backdrop

What is Monochrome?

Monochrome achievement is awarded to gifts where the model visually blends with the backdrop due to similar colors. This creates a unique aesthetic where the model appears to merge with its background, rather than standing out.

βœ“ Monochrome Match
Blue model on blue backdrop β€” colors blend harmoniously
βœ—βœ— No Match
Contrasting colors β€” model stands out from backdrop
Detection Algorithm
1

Model Classification

First, we classify each model as monochromatic or not. This flag is stored in the database and set in two stages:

Automatic Analysis
Script analyzes image contrast and color distribution for initial classification
Manual Verification
Our team reviews and corrects classifications manually
gift_models.monochrome = TRUE | FALSE
2

Color Data Storage

For each model and backdrop, we store color information in multiple formats:

FieldExampleDescription
color_hex#4A90D9Original hex color from sprite/first animation frame or averaged gradient color
oklch_l0.62Lightness in OKLCH (0-1)
oklch_c0.12Chroma/saturation in OKLCH
oklch_h245Β°Hue angle in degrees
3

Color Space Conversion

To compare colors perceptually, we convert hex colors to OKLab color space:

// Gamma correction
sRGB β†’ linear RGB
c <= 0.04045 ? c/12.92 : ((c+0.055)/1.055)^2.4
// Matrix transformation
linear RGB β†’ LMS β†’ OKLab (L, a, b)
// Extract chroma
Chroma = √(a² + b²)
Chroma measures how colorful vs. neutral/gray a color is
4

Color Similarity Check

Finally, we compare model and backdrop colors using three rules:

Neutral Check
C < 0.03
Gray/neutral colors (low chroma) can only match other neutrals
Euclidean Distance
Ξ”E < 0.162
Overall color difference in OKLab space must be small
Ξ”E = √((L₁-Lβ‚‚)Β² + (a₁-aβ‚‚)Β² + (b₁-bβ‚‚)Β²)
Hue Angle
Δθ < 30Β°
For chromatic colors, hue directions must be similar
ΞΈ = arccos((a₁·aβ‚‚ + b₁·bβ‚‚) / (C₁·Cβ‚‚))
OKLab Color Space

OKLab is a perceptually uniform color space β€” distances correspond to how humans perceive color differences.

L
Lightness
0 = black, 1 = white
a
Green ↔ Red
β‰ˆ -0.4 to +0.4
b
Blue ↔ Yellow
β‰ˆ -0.4 to +0.4
Why OKLab over RGB?
  • RGB distance doesn't match human perception
  • OKLab treats all hues equally
  • Better for detecting subtle color matches
Model Classification Examples

Models are classified as monochrome or not based on their visual characteristics:

Monochrome Modelmonochrome = TRUE
🐳
Whale
Single dominant hue throughout the design
Dominant color:#4A90D9
βœ—Contrasting Modelmonochrome = FALSE
🦜
Parrot
Multiple distinct colors in the design
Multiple colors:
Gift Examples

Even with a monochrome model, the gift only earns the achievement if backdrop color matches:

βœ“ Monochrome Achievement
🐳
Model:
#4A90D9
Backdrop:
#3B82F6
Ξ”E = 0.08 < 0.162 βœ“
β‰ˆβ‰ˆ Near Miss
🐳
Model:
#4A90D9
Backdrop:
#F97316
Ξ”E = 0.31 > 0.162 βœ—

Same monochrome model, but orange backdrop creates too much contrast in OKLab space

πŸ’‘
In Summary

A gift receives Monochrome achievement when its model is flagged as monochromatic AND the model's color closely matches the backdrop's color in OKLab space. This ensures the visual "blending" effect is actually perceptible.

if model.monochrome = TRUE
Β Β AND oklab_similar(model.color, backdrop.color)
then award "Monochrome"