Complementary lang colors (#76)
This commit is contained in:
@@ -1067,7 +1067,7 @@ It is possible to use custom colors for languages if those provided by GitHub do
|
||||
You can specify either an index with a color, or a language name (case insensitive) with a color.
|
||||
Colors can be either in hexadecimal format or a [named color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
||||
|
||||
Use the special value `rainbow` to use rainbow colors.
|
||||
Use the special value `rainbow` to use rainbow colors. Use `complementary` to use [complementary colors](https://en.wikipedia.org/wiki/Complementary_colors).
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
//Custom colors
|
||||
if (`${colors}` === "rainbow")
|
||||
colors = ["0:#ff0000", "1:#ffa500", "2:#ffff00", "3:#008000", "4:#0000ff", "5:#4b0082", "6:#ee82ee", "7:#162221"]
|
||||
if (`${colors}` === "complementary")
|
||||
colors = ["0:#ff0000", "1:#008000", "2:#ffa500", "3:#0000ff", "4:#ffff00", "5:#4b0082", "6:#162221", "7:#ee82ee"]
|
||||
|
||||
colors = Object.fromEntries(decodeURIComponent(colors).split(",").map(x => x.trim().toLocaleLowerCase()).filter(x => x).map(x => x.split(":").map(x => x.trim())))
|
||||
console.debug(`metrics/compute/${login}/plugins > languages > custom colors ${JSON.stringify(colors)}`)
|
||||
//Iterate through user's repositories and retrieve languages data
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
}],
|
||||
["Language plugin (custom color set)", {
|
||||
plugin_languages:true,
|
||||
plugin_languages_colors:"rainbow",
|
||||
plugin_languages_colors:"complementary",
|
||||
}],
|
||||
["Language plugin (complete)", {
|
||||
plugin_languages:true,
|
||||
|
||||
Reference in New Issue
Block a user