fix: text color detection bug fixed #19
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When selecting text elements in the editor (particularly headings), the properties panel was displaying text color as #000000 (black) even when the actual text had a different color (like red). This created a disconnect between what users saw in the editor and what was shown in the color properties panel.
My Approach:
Modified the
ColorInput
component to better handle text elements(p, h1-h6, span, div)
by prioritizing the computed color values directly from the DOM, ensuring that both inherited and applied colors are displayed correctly.Refined the
isColorEmpty
utility function to more accurately determine when a color is truly empty, preventing valid color values (such as black) from being incorrectly treated as empty.Related Issues
closes onlook-dev#1528
Type of Change
Screenshots (if applicable)
https://drive.google.com/file/d/1e8t2h5EoVcqeLmFiZyMKZ_ft6KkSCEBH/view?usp=drive_link
Additional Notes