Add name to gimp palette output
This commit is contained in:
parent
5d5682d387
commit
5c87546c39
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
<title>Talia: A colour palette</title>
|
||||
<title>Talia</title>
|
||||
|
||||
<h1>Talia: A colour palette</h1>
|
||||
|
||||
|
@ -294,10 +294,10 @@
|
|||
const exportGimpButton = document.querySelector("#export-gimp")
|
||||
exportGimpButton.addEventListener("click", event => {
|
||||
const colours = Array.from(document.querySelectorAll("colour-palette")).map(palette => palette.colours)
|
||||
const template = `GIMP Palette\nName: Palette\nColumns: ${colours.length}\n#\n${colours.map(c => c.map(c=>c.join(' ')).join("\n")).join("\n#\n")}`
|
||||
const template = `GIMP Palette\nName: ${document.title}\nColumns: 9\n#\n${colours.map(c => c.map(c=>c.join(' ')).join("\n")).join("\n#\n")}`
|
||||
const link = document.createElement("a")
|
||||
link.href = `data:text/plain;base64,${btoa(template)}`
|
||||
link.download = "palette.gpl"
|
||||
link.download = `${document.title.toLowerCase()}.gpl`
|
||||
link.click()
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue