Created
October 20, 2020 13:20
-
-
Save sempostma/1009babbb65d40c76b8b032748d87413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gradient = ["#11a7b6", "#29b827", "#f8bf00", "#f66d31", "#ef66a0"] | |
var parts = gradient.map((x, i, self) => `${x} ${i / self.length * 100}%, ${x} ${(i + 1) / self.length * 100}%`) | |
var result = `linear-gradient(90deg, ${parts.join(', ')})` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment