Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 36be7c4d1319d8851a67c5f3aa0abd9f60b3d02e
https://github.com/WebKit/WebKit/commit/36be7c4d1319d8851a67c5f3aa0abd9f60b3d02e
Author: Anuj Panta <[email protected]>
Date: 2026-03-04 (Wed, 04 Mar 2026)
Changed paths:
M Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
M Source/WebInspectorUI/UserInterface/Views/ColorPicker.js
M Source/WebInspectorUI/UserInterface/Views/ColorSquare.js
M Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js
Log Message:
-----------
Web Inspector: Color Picker should show contrast information when editing
background color properties
https://bugs.webkit.org/show_bug.cgi?id=308800
rdar://171332734
Reviewed by Devin Rousso.
Since contrast ratio is symmetric, the same contrast UI works for
background color properties by using the computed text color as the
reference instead of the computed background color.
Renamed contrast variables throughout the chain from "backgroundColor"
to "contrastColor"/"contrastReferenceColor" so the naming is accurate
regardless of which direction the contrast is being measured. The "vs"
swatch tooltip now shows "Text Color" or "Background Color" depending
on which property is being edited.
* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.async colorInputsWrapperElement):
(WI.ColorPicker.prototype._createContrastInfoSection):
(WI.ColorPicker.prototype._updateContrastInfo):
(WI.ColorPicker):
* Source/WebInspectorUI/UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
(WI.ColorSquare.prototype.get contrastColor):
(WI.ColorSquare.prototype.set contrastColor):
(WI.ColorSquare.prototype._updateBaseColor):
(WI.ColorSquare.prototype._drawContrastLines):
(WI.ColorSquare.prototype._calculateContrastLinePoints):
(WI.ColorSquare.prototype._findBrightnessForLuminance):
(WI.ColorSquare.prototype._updateContrastLabel):
(WI.ColorSquare.prototype.get contrastBackgroundColor): Deleted.
(WI.ColorSquare.prototype.set contrastBackgroundColor): Deleted.
* Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.inlineSwatchGetContrastInfo):
Canonical link: https://commits.webkit.org/308653@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications