mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
Password Generator finished and working
This commit is contained in:
parent
e348ea2aa9
commit
5930e8764d
5 changed files with 235 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ export async function colorConvert(app: FastifyInstance) {
|
|||
return reply.status(400).send({ error: "No RGB declared!" });
|
||||
}
|
||||
const hex = (`#${(+data.red).toString(16).padStart(2, "0")}${(+data.green).toString(16).padStart(2, "0")}${(+data.blue).toString(16).padStart(2, "0")}`).toUpperCase();
|
||||
reply.header("Content-Type", "application/json").send({ hex: hex });
|
||||
reply.header("Content-Type", "text/plain").status(200).send(hex);
|
||||
} catch (error) {
|
||||
console.error("Convert error:", error);
|
||||
reply.status(500).send({ error: "Error while converting!" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue