We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It's not a perfect match for this package, but it seems like a reasonable home:
rel_l <- function(x) { scale <- function(x) { ifelse(x <= 0.03928, x / 12.92, ((x + 0.055) / 1.055)^2.4) } rgb <- farver::decode_colour(x) / 255 0.2126 * scale(rgb[, 1]) + 0.7152 * scale(rgb[, 2]) + 0.0722 * scale(rgb[, 3]) } contrast_ratio <- function(x, y) { x_l <- rel_l(x) y_l <- rel_l(y) (pmax(x_l, y_l) + 0.05) / (pmin(x_l, y_l) + 0.05) }
This implements the WCAG 2.0 colour contrast computation (https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html) which is useful for checking that colours have sufficient contrast to be easily readable.
The text was updated successfully, but these errors were encountered:
624167e
No branches or pull requests
It's not a perfect match for this package, but it seems like a reasonable home:
This implements the WCAG 2.0 colour contrast computation (https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html) which is useful for checking that colours have sufficient contrast to be easily readable.
The text was updated successfully, but these errors were encountered: