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

Polyad colors #126

Closed
wants to merge 7 commits into from
Closed

Polyad colors #126

wants to merge 7 commits into from

Conversation

jpwesterhof
Copy link

  • Adds functionality to not only get triad and tetrad colors from a color
    but also n-ad colors using n as an argument. n = 3: triad, n = 4:
    tetrad, n = 5 pentad, etc...
  • Added more convenience functions like the existing triad and tetrad.

Adds functionality to not only get triad and tetrad colors from a color
but also n-ad colors using n as an argument. n = 3: triad, n = 4:
tetrad, n = 5 pentad, etc...
Added more convenience functions like the existing triad and tetrad.
@jpwesterhof
Copy link
Author

I was a bit messy with my first two commits, because I copy pasted it from code I currently use. Hence the two follow up commits with fixes to these two forgotten characters (, and ;).

@bgrins
Copy link
Owner

bgrins commented Apr 14, 2016

Alright, sounds good. I'd rather only export triad and tetrad (and not export all the others), but then expose the new one that allows a variable number of outputs. I believe we could call it 'polyad', which is what I could find as the name for these groupings: https://en.wiktionary.org/wiki/polyad

@jpwesterhof
Copy link
Author

Done

@jpwesterhof
Copy link
Author

Forgot about the internals... done

@jpwesterhof jpwesterhof changed the title N-ad colors Polyad colors Apr 20, 2016
@thaliaarchi
Copy link

This sounds like a cool idea. These need to pass arguments to _applyCombination like the other public methods. So, just make the private triad and tetrad functions call polyad with 3 or 4 as n.

triad: function() {
    return this._applyCombination(triad, arguments);
},
tetrad: function() {
    return this._applyCombination(tetrad, arguments);
},
polyad: function() {
    return this._applyCombination(polyad, arguments);
}

...

function triad(color) {
    return polyad(color, 3);
}

function tetrad(color) {
    return polyad(color, 4);
}

@scttcper scttcper mentioned this pull request May 9, 2018
@bgrins bgrins mentioned this pull request Dec 22, 2022
@bgrins
Copy link
Owner

bgrins commented Dec 22, 2022

Landed this in #250. Thanks @jpwesterhof and sorry for dropping this

@bgrins bgrins closed this Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants