Skip to content
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

Use max contrast variable to cap the generated colours #14776

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Mar 21, 2019

Before
Capture d’écran_2019-03-21_08-46-48

After
Capture d’écran_2019-03-21_08-45-31

@nextcloud/designers

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added bug design Design, UI, UX, etc. 3. to review Waiting for reviews labels Mar 21, 2019
@skjnldsv skjnldsv added this to the Nextcloud 16 milestone Mar 21, 2019
@skjnldsv skjnldsv self-assigned this Mar 21, 2019
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense 👍

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code could be improved, but makes sense 👍


// ensure that the brightest color is still readable
// min. color contrast for normal text on white background according to WCAG AA
if (sizeColor >= maxContrast) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Math.min and Math.max to your advantage

x = Math.max(min, Math.min(max, x))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this in a follow-up PR.

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 21, 2019
@MorrisJobke MorrisJobke merged commit 651495e into master Mar 21, 2019
@MorrisJobke MorrisJobke deleted the fix/files/size-color branch March 21, 2019 08:59
@MorrisJobke MorrisJobke mentioned this pull request Mar 21, 2019
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug design Design, UI, UX, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants