Skip to content

Use max contrast variable to cap the generated colours - #14776

Merged
MorrisJobke merged 1 commit into
masterfrom
fix/files/size-color
Mar 21, 2019
Merged

Use max contrast variable to cap the generated colours#14776
MorrisJobke merged 1 commit into
masterfrom
fix/files/size-color

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Mar 21, 2019

Copy link
Copy Markdown
Member

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>
@skjnldsvskjnldsv added bug design Design, UI, UX, etc. 3. to review Waiting for reviews labels Mar 21, 2019
@skjnldsvskjnldsv added this to the Nextcloud 16 milestone Mar 21, 2019
@skjnldsvskjnldsv self-assigned this Mar 21, 2019

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code makes sense 👍

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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.

@MorrisJobkeMorrisJobke 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 masterMar 21, 2019
@MorrisJobke
MorrisJobke deleted the fix/files/size-color branch March 21, 2019 08:59
@MorrisJobkeMorrisJobke mentioned this pull request Mar 21, 2019
9 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugdesignDesign, UI, UX, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@skjnldsv@MorrisJobke@ChristophWurst@Charburner