1
Fork 0

Documentation!

This commit is contained in:
Bauke 2023-08-02 12:46:13 +02:00
parent 4e81b0be9b
commit fbbf424cb5
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,7 @@ async function main(): Promise<void> {
}
}
/** Customizable options for the GEGL graph. */
type GraphOptions = {
fontSize: number;
height: number;
@ -74,6 +75,7 @@ type GraphOptions = {
width: number;
};
/** Create the GEGL graph for the project avatar image. */
function geglGraph({ fontSize, height, text, width }: GraphOptions): string[] {
const graph = `
gegl:text
@ -97,6 +99,7 @@ function geglGraph({ fontSize, height, text, width }: GraphOptions): string[] {
color=black
length=20`;
// Replace duplicate whitespace with newlines and then split by those newlines.
return graph.replace(/\s\s+/g, "\n").trim().split("\n");
}