Day for Night (2026-05-29 17:57)

Please be advised that the following was written or last updated a while ago and may therefore contain outdated information or opinions I no longer hold. 请知悉下文自写作或上次更新已届相当时限,或包含过时信息及已摒弃观点。

Marcin Wichary:

But there’s a trick [to invert black and white while preserving colors]: do a regular invert and then rotate the hue halfway through. Through the magic of math, this is the same as inverting just L in the HSL space, which means the colors are preserved.

…and, more importantly, [this is] available in CSS as a filter: instead of invert(1), use hue-rotate(180deg) invert(1).