Feature: Add Preserve colors option in dark mode #111
Merged
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.
Note: This is a re-implementation of the preserve-colors feature proposed in #106 to resolve conflicts introduced by @waymondrang in the redesign.
Problem
The Invert checkbox inverts all colored text in the Google doc.
However, this is very unintuitive since you'll have to guess at the opposite color if you want to set the text to a particular color - e.g. for green text, you'll have to set it to magenta.
This was referenced in these issues:
#95
#77
Feature
Add a "Preserve Colors" checkbox to prevent colored text from being inverted in dark mode.

This keeps the existing text hues as they are and allows only the brightness to change so only black and white text get flipped as usual.
Code Changes
src/types.ts- add a new flag toInvertMode.src/values.ts- add the new invert mode and set that as the default option (This is the default behaviour most users would naturally expect from dark mode - people don't want everything to be turned to grayscale).src/docs.ts- add new case for preserve_colors option.src/popup.html- added new "Preserve Colors" alongside existing "Gray" and "Black" in UI.src/popup.ts- implement event listener and button element.P.S: Please don't make any other changes before merging this (unless there's no conflicts obviously) - I really don't want to have to keep reimplmenting the feature over and over just to keep up with changes. Thanks 🙏🏻