Skip to content

Allow random colors in borderColor array#7

Merged
webmatze merged 2 commits intowebmatze:masterfrom
flakmonkey:master
Sep 24, 2016
Merged

Allow random colors in borderColor array#7
webmatze merged 2 commits intowebmatze:masterfrom
flakmonkey:master

Conversation

@flakmonkey
Copy link
Copy Markdown

Hi there. First of all, good work on this fun little project!

I'm not sure if you're looking for these kinds of changes, but they enabled my to do what I wanted to do with this project.

Border settings this enables:

borderColors: '#fff' // white border
borderColors: 'random',  // border of one random color
borderColors: ['random', '#fff'],  // random now works within this array
borderColors: ['random'],  // same as 2nd example

Of course, this breaks how borderColors: 'random' worked previously, since that would create a gradient of two random colors, and now it would only be a single solid-color border.

If it's preferable to keep that behavior, line 8 could be change to:

return colors.length < 2 ? colors.concat('random') : colors;

Copy link
Copy Markdown
Owner

@webmatze webmatze left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you for your contribution to hyperborder. I will add your comments to the README and then publish a new version later.

@webmatze webmatze merged commit 9850a1f into webmatze:master Sep 24, 2016
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.

2 participants