Open coatless opened 9 months ago
In Python, two popular packages we could use appear to be:
In Quarto, I need to play with the shortcode a little more, but I have the sense we could address this with a class, like .dark
. The current assumption in the CSS is that we have dark text on a light background, and a .dark
class could flip that around. Those would only work for people who only want to pick three-four colors for the states, otherwise they'd have to specify all the colors. That seems like a reasonable compromise to me.
@gadenbuie okidokie, I like both options!
Any thoughts as to the quarto-specific parameter option? color_darken: true
?
Do you have any preference on the Python package? Glancing at py-htmltools
, neither package suggested is being used.
So, going over to usage statistics, we have:
colour
: ~ 825,673 downloads last monthbasic-colormath
: ~ 104 downloads last monthGlancing at dependencies, we also have:
colour
: python, imageio, numpy, scipy, and typing-extensions.basic-colormath
just python.Lastly, for releases, we have:
colour
: Nov 19, 2017 with version 0.1.5basic-colormath
: May 1, 2023 with version 0.1.0Maybe we opt for basic-colormath
over colour
as we don't need that extensive of features?
In the R version of
{countdown}
, there's a quick comparison of values to select either adark
orlight
color value depending on what a user specifies. The relevant functions being used in R for this decision are from{prismatic}
:prismatic::clr_lighten()
(Show stopper)prismatic::clr_darken()
(depends onclr_lighten()
)prismatic::best_contrast()
With #36, the CSS countdown variables now have a darkening characteristic applied:
https://github.com/gadenbuie/countdown/blob/9ee6b7fa18aadc3540031184d72a812abcd85381/lib/countdown.css#L4
From discussions in #35 we have:
If the CSS property
color-contrast
was implemented in browsers, then this would be a non-issue.Options in the interim: JavaScript? Re-implement
{prismatic}
in the different languages? Wait for browser updates?