InterpolableColor in Blink: Architecture and Animation Logic
Blink2863 Huhti

InterpolableColor in Blink: Architecture and Animation Logic

The provided sources describe InterpolableColor, a specialized component within the Blink rendering engine used to handle CSS color animations on the main thread. This system utilizes a dual-path architecture where InterpolableColor acts as a high-performance numeric representation for absolute colors, while InterpolableStyleColor serves as a deferred "escape hatch" for complex, unresolved color functions. To ensure efficiency and accuracy, the engine stores color channels using premultiplied-alpha math and limits direct interpolation to rectangular color spaces like Oklab and sRGB. A sophisticated feature of this framework is its ability to carry keyword fractions, allowing the engine to interpolate symbolic values like currentcolor by resolving them only at the final stage of the animation pipeline. Because these objects are managed by Blink's garbage collector (Oilpan), they are generally restricted to the main thread rather than the compositor. Ultimately, this infrastructure bridges the gap between high-level CSS semantics and the concrete color values required for browser painting.


Jaksot(473)