feat: added bg_color options, added RepoCard color options too

This commit is contained in:
anuraghazra
2020-07-12 12:46:08 +05:30
parent 61a0f517db
commit 9af56df2c1
6 changed files with 99 additions and 15 deletions

View File

@@ -4,7 +4,14 @@ const fetchRepo = require("../src/fetchRepo");
const renderRepoCard = require("../src/renderRepoCard");
module.exports = async (req, res) => {
const { username, repo } = req.query;
const {
username,
repo,
title_color,
icon_color,
text_color,
bg_color,
} = req.query;
let repoData;
res.setHeader("Content-Type", "image/svg+xml");
@@ -16,5 +23,12 @@ module.exports = async (req, res) => {
return res.send(renderError(err.message));
}
res.send(renderRepoCard(repoData));
res.send(
renderRepoCard(repoData, {
title_color,
icon_color,
text_color,
bg_color,
})
);
};