imfing / hextra

🔯 Modern, batteries-included Hugo theme for creating beautiful doc, blog and static websites
https://imfing.github.io/hextra/
MIT License
757 stars 177 forks source link

feat: add customizable primary lightness support #470

Closed Gr3q closed 1 month ago

Gr3q commented 1 month ago

Lightness is adjusted in a way that --primary-lightness becomes the midpoint of the 0-100% range and the calculated result will never go out of that range, it's not a simple addition. 95% lightness is still almost white and 5% is still almost completely black.

This seem to work pretty well with the exception that hextra seem to apply 5% lower lightness in most prominent places (links and buttons), so you need to consistently add +5% lightness to your --primary-lightness value but I'm not going to fix that in this PR.

Very high and very low --primary-lightness values are not recommended, but they do work.

Something to visualize the algorithm on a 0-100 scale: https://www.desmos.com/calculator/lsdmffszmy (Y is base color lightness, x is the target lightness)

netlify[bot] commented 1 month ago

Deploy Preview for hugo-hextra ready!

Name Link
Latest commit d68bfc006ed599f0ab6ccab3cb2bdec03d52049c
Latest deploy log https://app.netlify.com/sites/hugo-hextra/deploys/6707b9dd6b85c20008759cd9
Deploy Preview https://deploy-preview-470--hugo-hextra.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

imfing commented 1 month ago

thank you for the PR, will take a look at it when i get chance