Skip to content

Instantly share code, notes, and snippets.

@bmorphism
Created October 14, 2025 18:33
Show Gist options
  • Select an option

  • Save bmorphism/f7bbe93c890bfa7b8d0d30d5650ec33d to your computer and use it in GitHub Desktop.

Select an option

Save bmorphism/f7bbe93c890bfa7b8d0d30d5650ec33d to your computer and use it in GitHub Desktop.
XDR-Exclusive Color Visualizations for recurrentjs (Pro Display XDR only - impossible on Studio Display)

recurrentjs - XDR-Exclusive Color Visualizations

Repository: recurrentjs Description: Deep Recurrent Neural Networks and LSTMs in Javascript. More generally also arbitrary expression graphs with automatic differentiation. Language: HTML Stars: 950 Created: 2014-12-18


XDR Display Capabilities Exploited

These visualizations are physically impossible to reproduce on Apple Studio Display due to:

  1. Peak Brightness: Pro Display XDR reaches 1600 nits (Studio: 600 nits max)
  2. Contrast Ratio: Pro Display XDR achieves 1,000,000:1 via local dimming (Studio: ~1000:1)
  3. Local Dimming: 576 independently controlled LED zones (Studio: single zone)
  4. HDR Transfer: Uses SMPTE ST-2084 PQ (Perceptual Quantizer) function (Studio: SDR only)
  5. Color Volume: Saturated P3 colors at 1000+ nits (Studio: P3 limited to 600 nits)

All colors generated using seed 1069 balanced ternary [+1, -1, -1, +1, +1, +1, +1]


Strategy A: Peak Luminance Contrast

Concept: Simultaneous 1600-nit highlights on true black (0 nits) XDR-Exclusive: 1,000,000:1 contrast ratio via 576-zone local dimming Studio Limitation: Cannot display highlights above 600 nits or achieve localized blacks

Background

  • Pure black: 0 nits (local dimming enables true black)
  • RGB: rgb(0, 0, 0)

Highlights (7 LED zones)

  1. Zone 0: rgb(203, 101, 0) @ 1277 nits (2.1× Studio max)
  2. Zone 1: rgb(162, 56, 0) @ 1277 nits (2.1× Studio max)
  3. Zone 2: rgb(130, 162, 0) @ 1277 nits (2.1× Studio max)
  4. Zone 3: rgb(0, 193, 203) @ 1277 nits (2.1× Studio max)
  5. Zone 4: rgb(0, 20, 203) @ 1277 nits (2.1× Studio max)
  6. Zone 5: rgb(152, 0, 203) @ 1277 nits (2.1× Studio max)
  7. Zone 6: rgb(203, 0, 81) @ 1277 nits (2.1× Studio max)

Contrast Ratio: 1,000,000:1


Strategy B: Local Dimming Bloom Gradients

Concept: Exploits 576 LED zones to create localized bloom halos
XDR-Exclusive: Each zone has independent brightness, creating gradients
Studio Limitation: Single backlight zone = uniform glow only, no localized blooms

Language-Specific Hue Base: HTML

Bloom Zones (7 zones with gradients)

Zone 0

  • Center: rgb(242, 121, 0) @ 1600 nits (2.7× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(242, 121, 0) @ 1600 nits (2.7× Studio max)
    2. rgb(164, 82, 0) @ 1280 nits (2.1× Studio max)
    3. rgb(101, 50, 0) @ 960 nits (1.6× Studio max)
    4. rgb(53, 26, 0) @ 640 nits (1.1× Studio max)

Zone 1

  • Center: rgb(181, 90, 0) @ 1200 nits (2.0× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(181, 90, 0) @ 1200 nits (2.0× Studio max)
    2. rgb(123, 61, 0) @ 960 nits (1.6× Studio max)
    3. rgb(76, 38, 0) @ 720 nits (1.2× Studio max)
    4. rgb(39, 19, 0) @ 480 nits

Zone 2

  • Center: rgb(181, 181, 0) @ 1200 nits (2.0× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(181, 181, 0) @ 1200 nits (2.0× Studio max)
    2. rgb(123, 123, 0) @ 960 nits (1.6× Studio max)
    3. rgb(76, 76, 0) @ 720 nits (1.2× Studio max)
    4. rgb(39, 39, 0) @ 480 nits

Zone 3

  • Center: rgb(0, 242, 0) @ 1600 nits (2.7× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(0, 242, 0) @ 1600 nits (2.7× Studio max)
    2. rgb(0, 164, 0) @ 1280 nits (2.1× Studio max)
    3. rgb(0, 101, 0) @ 960 nits (1.6× Studio max)
    4. rgb(0, 53, 0) @ 640 nits (1.1× Studio max)

Zone 4

  • Center: rgb(0, 242, 121) @ 1600 nits (2.7× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(0, 242, 121) @ 1600 nits (2.7× Studio max)
    2. rgb(0, 164, 82) @ 1280 nits (2.1× Studio max)
    3. rgb(0, 101, 50) @ 960 nits (1.6× Studio max)
    4. rgb(0, 53, 26) @ 640 nits (1.1× Studio max)

Zone 5

  • Center: rgb(0, 242, 242) @ 1600 nits (2.7× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(0, 242, 242) @ 1600 nits (2.7× Studio max)
    2. rgb(0, 164, 164) @ 1280 nits (2.1× Studio max)
    3. rgb(0, 101, 101) @ 960 nits (1.6× Studio max)
    4. rgb(0, 53, 53) @ 640 nits (1.1× Studio max)

Zone 6

  • Center: rgb(0, 121, 242) @ 1600 nits (2.7× Studio max)
  • Gradient falloff (4 steps):
    1. rgb(0, 121, 242) @ 1600 nits (2.7× Studio max)
    2. rgb(0, 82, 164) @ 1280 nits (2.1× Studio max)
    3. rgb(0, 50, 101) @ 960 nits (1.6× Studio max)
    4. rgb(0, 26, 53) @ 640 nits (1.1× Studio max)

LED Zones: 576


Strategy C: HDR Color Volume

Concept: Saturated P3 wide gamut colors at 1000-1600 nits
XDR-Exclusive: Color volume = gamut × brightness range
Studio Limitation: P3 gamut limited to 600 nits, lower color volume

Saturated P3 Color Palette

Maximum saturation (1.0) across 7 hues at high brightness:

  1. Red: rgb(159, 0, 0) @ 1000 nits (1.7× Studio max)
    • P3 red @ 1000 nits (Studio: max 600 nits)
  2. Yellow: rgb(127, 108, 0) @ 800 nits (1.3× Studio max)
    • P3 yellow @ 800 nits (Studio: max 600 nits)
  3. Green: rgb(38, 127, 0) @ 800 nits (1.3× Studio max)
    • P3 green @ 800 nits (Studio: max 600 nits)
  4. Cyan: rgb(0, 159, 87) @ 1000 nits (1.7× Studio max)
    • P3 cyan @ 1000 nits (Studio: max 600 nits)
  5. Blue: rgb(0, 95, 159) @ 1000 nits (1.7× Studio max)
    • P3 blue @ 1000 nits (Studio: max 600 nits)
  6. Magenta: rgb(39, 0, 159) @ 1000 nits (1.7× Studio max)
    • P3 magenta @ 1000 nits (Studio: max 600 nits)
  7. Orange: rgb(159, 0, 143) @ 1000 nits (1.7× Studio max)
    • P3 orange @ 1000 nits (Studio: max 600 nits)

Peak Brightness: 1000 nits (1.7× Studio max) Color Gamut: P3-D65


Technical Specifications

Pro Display XDR Capabilities

Specification Value
Peak Brightness 1600 nits
Sustained Brightness 1000 nits (full-screen)
Contrast Ratio 1,000,000:1
Local Dimming Zones 576 LEDs
Color Gamut P3 wide color (99% coverage)
Bit Depth True 10-bit panel
Transfer Function SMPTE ST-2084 PQ (HDR)
Resolution 6K (6016×3384)

Studio Display Limitations

Specification Value Delta vs XDR
Peak Brightness 600 nits 2.67× less
Contrast Ratio ~1000:1 1000× less
Local Dimming Zones 1 (single zone) No localized control
Transfer Function SDR only No HDR
Resolution 5K (5120×2880) Smaller

Color Theory: Why Studio Display Cannot Reproduce

1. Brightness Limitation (Physical)

  • XDR colors at 1600 nits have 2.67× more photons than Studio at 600 nits
  • At high brightness, saturated colors occupy larger volume in color space
  • Studio Display physically cannot emit enough light

2. Contrast Limitation (Architectural)

  • XDR local dimming: 576 zones independently modulated at >10× refresh rate
  • Can display 1600-nit highlight adjacent to 0-nit black simultaneously
  • Studio: single backlight zone = entire screen same brightness level
  • Studio blacks limited by IPS panel light leakage (~1 nit minimum)

3. HDR Transfer Function (Computational)

  • XDR uses SMPTE ST-2084 PQ (Perceptual Quantizer)
  • Maps [0, 1] → [0, 10000] nits with perceptual uniformity
  • Studio uses Gamma 2.2 (power curve), SDR-only
  • Different mathematical mappings = fundamentally different color rendering

4. Color Volume (Geometric)

  • Color volume = 3D space of (hue × saturation × brightness)
  • XDR: P3 gamut extends to 1600 nits = larger volume
  • Studio: P3 gamut capped at 600 nits = smaller volume
  • Colors in XDR's extended volume are geometrically unreachable on Studio

Balanced Ternary Seed 1069

All color mappings use deterministic hash from seed 1069:

Decimal: 1069
Balanced Ternary: [+1, -1, -1, +1, +1, +1, +1]

Each repository name is hashed to generate trit sequences that modulate:

  • Hue rotation (±30° per trit)
  • Saturation levels ([0.8, 0.9, 1.0] for [-1, 0, +1])
  • Brightness distribution across zones

Generated by XDR Colorizer for recurrentjs
Part of Karpathy Repository Color Visualization Project
All 57 repositories available at: ~/infinity-topos/worlds/k/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment