Repository: anuraghazra/github-readme-stats
Pull request #2594 (2023-03-30 02:20:43)

add github_dark_dimmed theme
## Preview with Github Dark Dimmed
![image](https://user-images.githubusercontent.com/3431285/228987745-0f22296e-6ef4-48d6-ac7b-907e21398b30.png)

## Preview with Github Default
![image](https://user-images.githubusercontent.com/3431285/228987867-af36dbd1-2db6-45ea-8a59-4d85a0084cbd.png)

vercel[bot]: @fabianocouto is attempting to deploy a commit to the **github readme stats** Team on [Vercel](https://vercel.com).

A member of the Team first needs to [authorize it](https://vercel.com/git/authorize?team=github%20readme%20stats&type=github&job=%7B%22headInfo%22%3A%7B%22sha%22%3A%22316ff45426523e2badaf2f82da7c8d7b2637cee6%22%7D%2C%22id%22%3A%22QmakzgiboxrAyt8QxQUmx8YyejEheHzc6s3yptT84TRthD%22%2C%22org%22%3A%22anuraghazra%22%2C%22prId%22%3A2594%2C%22repo%22%3A%22github-readme-stats%22%7D).


github-actions[bot]: 
      # Automated Theme Preview
      
  Hi, thanks for the theme contribution. Please read our theme [contribution guidelines](https://github.com/anuraghazra/github-readme-stats/blob/master/CONTRIBUTING.md#themes-contribution).
  We are currently only accepting color combinations from any VSCode theme or themes with good colour combinations to minimize bloating the themes collection.

  > Also, note that if this theme is exclusively for your personal use, then instead of adding it to our theme collection, you can use card [customization options](https://github.com/anuraghazra/github-readme-stats#customization).

    
      :x: Theme PR does not adhere to our guidelines.
      ## Test results
      - :x: github_dark_dimmed

      **Result:** :x: Some themes are invalid.


  Unfortunately, your theme PR contains an error or does not adhere to our [theme guidelines](https://github.com/anuraghazra/github-readme-stats/blob/master/CONTRIBUTING.md#themes-contribution). Please fix the issues below, and we will review your   PR again. This pull request will **automatically close in 20 days** if no changes are made. After this time, you must re-open the PR for it to be reviewed.

      
      ## Details
      
        ### Github_dark_dimmed theme preview
        
        - :warning: `title_color` does not pass [AA contrast ratio](https://webaim.org/resources/contrastchecker/?fcolor=2F80EE&bcolor=24292F).
- :warning: `icon_color` does not pass [AA contrast ratio](https://webaim.org/resources/contrastchecker/?fcolor=2F80EE&bcolor=24292F).


        
title_color: <code>#2F80EE</code> | icon_color: <code>#2F80EE</code> | text_color: <code>#ADBAC7</code> | bg_color: <code>#24292F</code> | border_color: <code>#373E47</code>

        [Preview Link](https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=2F80EE&icon_color=2F80EE&text_color=ADBAC7&bg_color=24292F&border_color=373E47&show_icons=true)

        [![](https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=2F80EE&icon_color=2F80EE&text_color=ADBAC7&bg_color=24292F&border_color=373E47&show_icons=true)](https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=2F80EE&icon_color=2F80EE&text_color=ADBAC7&bg_color=24292F&border_color=373E47&show_icons=true)
      
    

Patch:
diff --git a/api/index.js b/api/index.js
index b449d43..e89c746 100644
--- a/api/index.js
+++ b/api/index.js
@@ -35,6 +35,7 @@ export default async (req, res) => {
     locale,
     disable_animations,
     border_radius,
+    number_format,
     border_color,
   } = req.query;
   res.setHeader("Content-Type", "image/svg+xml");
@@ -88,6 +89,7 @@ export default async (req, res) => {
         custom_title,
         border_radius,
         border_color,
+        number_format,
         locale: locale ? locale.toLowerCase() : null,
         disable_animations: parseBoolean(disable_animations),
       }),
diff --git a/readme.md b/readme.md
index 7a60228..91a1cfa 100644
--- a/readme.md
+++ b/readme.md
@@ -289,6 +289,7 @@ You can provide multiple comma-separated values in the bg_color option to render
 -   `text_bold` - Use bold text _(boolean)_. Default: `true`.
 -   `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
 -   `ring_color` - Color of the rank circle _(hex color)_. Defaults to the theme ring color if it exists and otherwise the title color.
+-   `number_format` - Switch between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). Default: `short`.
 
 > **Note**
 > When hide_rank=`true`, the minimum card width is 270 px + the title length and padding.
diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js
index f39a968..c60ea51 100644
--- a/src/cards/stats-card.js
+++ b/src/cards/stats-card.js
@@ -39,8 +39,10 @@ const createTextNode = ({
   showIcons,
   shiftValuePos,
   bold,
+  number_format,
 }) => {
-  const kValue = kFormatter(value);
+  const kValue =
+    number_format.toLowerCase() === "long" ? value : kFormatter(value);
   const staggerDelay = (index + 3) * 150;
 
   const labelOffset = showIcons ? `x="25"` : "";
@@ -103,6 +105,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
     custom_title,
     border_radius,
     border_color,
+    number_format = "short",
     locale,
     disable_animations = false,
   } = options;
@@ -192,6 +195,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
         showIcons: show_icons,
         shiftValuePos: 79.01 + (isLongLocale ? 50 : 0),
         bold: text_bold,
+        number_format,
       }),
     );
 
diff --git a/src/cards/types.d.ts b/src/cards/types.d.ts
index 52ee0ed..a3abc23 100644
--- a/src/cards/types.d.ts
+++ b/src/cards/types.d.ts
@@ -22,6 +22,7 @@ export type StatCardOptions = CommonOptions & {
   line_height: number | string;
   custom_title: string;
   disable_animations: boolean;
+  number_format: string;
 };
 
 export type RepoCardOptions = CommonOptions & {
diff --git a/src/common/languageColors.json b/src/common/languageColors.json
index b50cba6..3937eec 100644
--- a/src/common/languageColors.json
+++ b/src/common/languageColors.json
@@ -133,6 +133,7 @@
     "Elixir": "#6e4a7e",
     "Elm": "#60B5CC",
     "Elvish": "#55BB55",
+    "Elvish Transcript": "#55BB55",
     "Emacs Lisp": "#c065db",
     "EmberScript": "#FFF4F3",
     "Erlang": "#B83998",
@@ -453,6 +454,7 @@
     "Smalltalk": "#596706",
     "Smarty": "#f0c040",
     "Smithy": "#c44536",
+    "Snakemake": "#419179",
     "Solidity": "#AA6746",
     "SourcePawn": "#f69e1d",
     "Squirrel": "#800000",
@@ -466,6 +468,7 @@
     "SugarSS": "#2fcc9f",
     "SuperCollider": "#46390b",
     "Svelte": "#ff3e00",
+    "Sway": "#dea584",
     "Swift": "#F05138",
     "SystemVerilog": "#DAE1C2",
     "TI Program": "#A0AA87",
diff --git a/themes/README.md b/themes/README.md
index b8649d4..5993b6a 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -32,10 +32,11 @@ Use `?theme=THEME_NAME` parameter like so :-
 | `jolly` ![jolly][jolly] | `maroongold` ![maroongold][maroongold] | `yeblu` ![yeblu][yeblu] |
 | `blueberry` ![blueberry][blueberry] | `slateorange` ![slateorange][slateorange] | `kacho_ga` ![kacho_ga][kacho_ga] |
 | `outrun` ![outrun][outrun] | `ocean_dark` ![ocean_dark][ocean_dark] | `city_lights` ![city_lights][city_lights] |
-| `github_dark` ![github_dark][github_dark] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] | `aura_dark` ![aura_dark][aura_dark] |
+| `github_dark` ![github_dark][github_dark] | `github_dark_dimmed` ![github_dark_dimmed][github_dark_dimmed] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple] |
 | `panda` ![panda][panda] | `noctis_minimus` ![noctis_minimus][noctis_minimus] | `cobalt2` ![cobalt2][cobalt2] |
 | `swift` ![swift][swift] | `aura` ![aura][aura] | `apprentice` ![apprentice][apprentice] |
 | `moltack` ![moltack][moltack] | `codeSTACKr` ![codeSTACKr][codeSTACKr] | `rose_pine` ![rose_pine][rose_pine] |
+|  `aura_dark` ![aura_dark][aura_dark] | | |
 | [Add your theme][add-theme] | | |
 
 ## Repo Card
@@ -60,10 +61,11 @@ Use `?theme=THEME_NAME` parameter like so :-
 | `jolly` ![jolly][jolly_repo] | `maroongold` ![maroongold][maroongold_repo] | `yeblu` ![yeblu][yeblu_repo] |
 | `blueberry` ![blueberry][blueberry_repo] | `slateorange` ![slateorange][slateorange_repo] | `kacho_ga` ![kacho_ga][kacho_ga_repo] |
 | `outrun` ![outrun][outrun_repo] | `ocean_dark` ![ocean_dark][ocean_dark_repo] | `city_lights` ![city_lights][city_lights_repo] |
-| `github_dark` ![github_dark][github_dark_repo] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] | `aura_dark` ![aura_dark][aura_dark_repo] |
+| `github_dark` ![github_dark][github_dark_repo] | `github_dark_dimmed` ![github_dark_dimmed][github_dark_dimmed_repo] | `discord_old_blurple` ![discord_old_blurple][discord_old_blurple_repo] |
 | `panda` ![panda][panda_repo] | `noctis_minimus` ![noctis_minimus][noctis_minimus_repo] | `cobalt2` ![cobalt2][cobalt2_repo] |
 | `swift` ![swift][swift_repo] | `aura` ![aura][aura_repo] | `apprentice` ![apprentice][apprentice_repo] |
 | `moltack` ![moltack][moltack_repo] | `codeSTACKr` ![codeSTACKr][codeSTACKr_repo] | `rose_pine` ![rose_pine][rose_pine_repo] |
+| `aura_dark` ![aura_dark][aura_dark_repo] | | |
 | [Add your theme][add-theme] | | |
 
 
@@ -117,8 +119,8 @@ Use `?theme=THEME_NAME` parameter like so :-
 [ocean_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=ocean_dark
 [city_lights]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=city_lights
 [github_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=github_dark
+[github_dark_dimmed]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=github_dark_dimmed
 [discord_old_blurple]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=discord_old_blurple
-[aura_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura_dark
 [panda]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=panda
 [noctis_minimus]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=noctis_minimus
 [cobalt2]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=cobalt2
@@ -128,7 +130,7 @@ Use `?theme=THEME_NAME` parameter like so :-
 [moltack]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=moltack
 [codeSTACKr]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=codeSTACKr
 [rose_pine]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=rose_pine
-
+[aura_dark]: https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide=contribs,prs&cache_seconds=86400&theme=aura_dark
 
 [default_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default
 [default_repocard_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=default_repocard
@@ -180,8 +182,8 @@ Use `?theme=THEME_NAME` parameter like so :-
 [ocean_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=ocean_dark
 [city_lights_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=city_lights
 [github_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=github_dark
+[github_dark_dimmed_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=github_dark_dimmed
 [discord_old_blurple_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=discord_old_blurple
-[aura_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura_dark
 [panda_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=panda
 [noctis_minimus_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=noctis_minimus
 [cobalt2_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=cobalt2
@@ -191,7 +193,7 @@ Use `?theme=THEME_NAME` parameter like so :-
 [moltack_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=moltack
 [codeSTACKr_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=codeSTACKr
 [rose_pine_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=rose_pine
-
+[aura_dark_repo]: https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&cache_seconds=86400&theme=aura_dark
 
 [add-theme]: https://github.com/anuraghazra/github-readme-stats/edit/master/themes/index.js
 
diff --git a/themes/index.js b/themes/index.js
index 0121cf0..ab8eab6 100644
--- a/themes/index.js
+++ b/themes/index.js
@@ -321,6 +321,13 @@ export const themes = {
     text_color: "C3D1D9",
     bg_color: "0D1117",
   },
+  github_dark_dimmed: {
+    title_color: "539bf5",
+    icon_color: "539bf5",
+    text_color: "ADBAC7",
+    bg_color: "24292F",
+    border_color: "373E47",
+  },
   discord_old_blurple: {
     title_color: "7289DA",
     icon_color: "7289DA",


Test patch:
diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js
index 748b7a3..110121a 100644
--- a/tests/renderStatsCard.test.js
+++ b/tests/renderStatsCard.test.js
@@ -357,4 +357,13 @@ describe("Test renderStatsCard", () => {
     document.body.innerHTML = renderStatsCard(stats, {});
     expect(document.querySelector("rect")).toHaveAttribute("rx", "4.5");
   });
+
+  it("should shorten values", () => {
+    stats["totalCommits"] = 1999;
+
+    document.body.innerHTML = renderStatsCard(stats);
+    expect(getByTestId(document.body, "commits").textContent).toBe("2k");
+    document.body.innerHTML = renderStatsCard(stats, { number_format: "long" });
+    expect(getByTestId(document.body, "commits").textContent).toBe("1999");
+  });
 });