Show the shadow palette in the clipping legend and pin both overlay checks.

The shadow warning gained per-channel colours but the legend only explained the
highlight palette, so the new marks had no key. The legend now switches to the
shadow palette whenever shadow clipping is on, listing one channel, the three
two-channel colours and all three. The render check also fails if the shadow
overlay stops following Exposure, the way the highlight side already did.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-28 14:58:03 +00:00
parent a67e9ef458
commit 6e80699829
3 changed files with 52 additions and 7 deletions
+19 -1
View File
@@ -217,6 +217,14 @@ try {
renderer.render(defaultEdits(), { width: w, height: h, clipping: 'shadows' });
const shadowPixels = [2, 3, 4, 5].map(sampleBand);
// And it has to move with the sliders, not just exist: -9 EV drives every
// channel of the clean band to black, so that band must turn white in shadow
// mode, just as it turns white at +6 EV in highlight mode.
const shadowEdits = defaultEdits();
shadowEdits.exposure = -9;
renderer.render(shadowEdits, { width: w, height: h, clipping: 'shadows' });
const shadowDarkPixel = sampleBand(2);
pre.textContent = 'RESULT ' + JSON.stringify({
clipPixels,
clipRed: near(clipPixels[0], RED_MARK),
@@ -233,6 +241,8 @@ try {
shadowRed: near(shadowPixels[1], RED_MARK),
shadowYellow: near(shadowPixels[2], YELLOW_MARK),
shadowCyan: near(shadowPixels[3], [26, 217, 255]),
shadowFollowsExposure: near(shadowDarkPixel, [255, 255, 255]),
shadowDarkPixel,
flagHonouredForBitmap: !same(proxyTop, proxyNoFlipTop),
proxyTop: +proxyTop.toFixed(4),
sidecarTop: +sideTop.toFixed(4),
@@ -384,7 +394,8 @@ async function main() {
`render check: shadow overlay clear=${JSON.stringify(result.shadowPixels[0])}` +
` red=${JSON.stringify(result.shadowPixels[1])}` +
` yellow=${JSON.stringify(result.shadowPixels[2])}` +
` cyan=${JSON.stringify(result.shadowPixels[3])}`,
` cyan=${JSON.stringify(result.shadowPixels[3])}` +
` | at -9EV the clean band is ${JSON.stringify(result.shadowDarkPixel)}`,
);
if (!result.matchTop || !result.matchBottom) {
console.error(
@@ -409,6 +420,13 @@ async function main() {
);
return 1;
}
if (!result.shadowFollowsExposure) {
console.error(
'render check FAILED: the shadow clipping overlay does not follow Exposure; ' +
`at -9EV the clean band stayed ${JSON.stringify(result.shadowDarkPixel)}.`,
);
return 1;
}
if (!result.clipFollowsExposure) {
console.error(
'render check FAILED: the clipping overlay does not follow Exposure; ' +
+22 -6
View File
@@ -2381,13 +2381,29 @@ export default function Develop({
</button>
</div>
)}
{clipPreview && (
{(clipPreview || clipping === 'shadows') && (
<div className="clip-legend">
<span className="clip-dot r" /> red
<span className="clip-dot g" /> green
<span className="clip-dot b" /> blue
<span className="clip-dot y" /> two channels
<span className="clip-dot w" /> all three
{clipPreview ? (
<>
<span className="clip-dot r" /> red
<span className="clip-dot g" /> green
<span className="clip-dot b" /> blue
<span className="clip-dot y" /> two channels
<span className="clip-dot w" /> all three
</>
) : (
<>
<span className="clip-dot r" />
<span className="clip-dot g" />
<span className="clip-dot b" />
<span className="clip-label">one channel</span>
<span className="clip-dot y" />
<span className="clip-dot m" />
<span className="clip-dot c" />
<span className="clip-label">two channels</span>
<span className="clip-dot w" /> all three
</>
)}
</div>
)}
{loupe && !adjustOpen && (
+11
View File
@@ -3435,10 +3435,21 @@ figcaption {
.clip-dot.y {
background: #ffe61a;
}
.clip-dot.m {
background: #ff26d9;
}
.clip-dot.c {
background: #1ad9ff;
}
.clip-dot.w {
background: #ffffff;
}
/* Groups the shadow palette dots so "one channel" reads with its own colours. */
.clip-legend .clip-label {
margin-right: 5px;
}
@media (max-width: 760px) {
.admin-create-grid {
grid-template-columns: 1fr 1fr;