-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[request] define link colors #34
Comments
Hey @atomGit Thank you for your review. it's highly appreciated. If you have more suggestions or thoughts, please don't hesitate to open issues – I'm all ears! Happy browsing with UltimaDark! |
if you care to explain, i am curious as to the method you're using to alter the colors - i looked through the code a bit, but i'm not really a programmer so i'm not understanding it - maybe you'd want to add this info in the readme |
Sure, thank you for asking UltimaDark stands out from other extensions in its category by altering colors even before the Firefox renderer processes them. The UltimaDark code intercepts the page content at an early stage, right after it is fetched from the remote website. This preemptive editing prevents the renderer from displaying the default bright colors of the website before applying the dark theme, eliminating the jarring white flash during page loading. During this initial edit, nothing has been parsed by the Firefox renderer yet—all values are still character strings. The challenge lies in identifying colors within these character strings and determining whether they will be used as background or foreground. This distinction is not an exact science, adding complexity to the process. Once a color is detected, it undergoes the appropriate transformation, either darkening or brightening. After the transformation is complete, the original value is replaced in the character string, ready to be read by the renderer. Let's focus specifically on the darkening transformation, as there are still refinements to be made in the brightening function. ² The darkening transformation begins by determining the lightness of the color. If it falls below a certain brightness threshold (B), it remains untouched, respecting the website's intended design. For lightness values above B, the edit ensures it never exceeds a maximum lightness (A). The lightness scale ranges from 0 to 1, where 0 is black and 1 is fully white—unsuitable for a background.
You can review the transformation function here: Desmos Transformation Function. UltimaDark also has the capability to edit pixels in images, although this feature is currently experimental and not fully functional. An example of the broken functionality can be seen on the Apple support page: Broken Example. On the other hand, the feature works better on the Sushi Spirit website: Not-So-Bad Example. |
The adjustment of website colors, rather than implementing a dark theme, aims to preserve the authenticity of the website's intended design. |
wow - this sounds very interesting - some Qs...
|
Upon reviewing my initial response, I identified some inaccuracies and have made the necessary corrections.
|
thank you for your comments - much appreciated i'll leave it to you to close this issue as you see fit since it was originally about link colors have a good one! |
Closing as duplicate. |
i gave it a quick spin and the most noticeable issue is link colors - consider adding the ability for users to define active, visited and default link colors like Dark Background and Light Text
other than that, and perhaps adding a quicker method to whitelist domains, subdomains and URL segments, it seems to work really well
The text was updated successfully, but these errors were encountered: