Skip to content

Implementing choose_light_or_dark() outside of R #51

@coatless

Description

@coatless

In the R version of {countdown}, there's a quick comparison of values to select either a dark or light color value depending on what a user specifies. The relevant functions being used in R for this decision are from {prismatic}:

With #36, the CSS countdown variables now have a darkening characteristic applied:

--_running-border-color: var(--countdown-color-running-border, rgba(0, 0, 0, 0.1));

From discussions in #35 we have:

I went with shading (darkening) in the CSS, but we could have tinted (lightend) as well with rgba(255, 255, 255, 0.1) or similar.

The question is how we'd know whether we should lighten or darken. But I'm okay waiting on that as well and working it out in follow up PRs.

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions