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

feature / improving color-yiq function #26846

Closed
wtorsi opened this issue Jul 10, 2018 · 2 comments
Closed

feature / improving color-yiq function #26846

wtorsi opened this issue Jul 10, 2018 · 2 comments

Comments

@wtorsi
Copy link
Contributor

wtorsi commented Jul 10, 2018

Hi,
The function is very great (thanks), but it will be much more convenient if we add some arguments, like below.
What do you think?

@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
  $r: red($color);
  $g: green($color);
  $b: blue($color);

  $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;

  @if ($yiq >= $yiq-contrasted-threshold) {
	@return $dark;
  } @else {
	@return $light;
  }
}
@MartijnCuppens
Copy link
Member

Great idea, can you make a PR for this @wtorsi?

@wtorsi
Copy link
Contributor Author

wtorsi commented Jul 18, 2018

@MartijnCuppens Yes, sure. But you need to fix your 'Contributing to Bootstrap' section.
Adding upstream master is not good idea for v4-dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants