Compare commits
2 commits
9343a28ca0
...
4935439056
Author | SHA1 | Date | |
---|---|---|---|
4935439056 | |||
4e5c17511c |
2 changed files with 8 additions and 3 deletions
|
@ -59,12 +59,12 @@ function App() {
|
|||
}
|
||||
// @ts-ignore
|
||||
let message = document.getElementById("ubuntucola").value as string
|
||||
setMessage(getmisskeycolors(message, colors));
|
||||
setMessage(getmisskeycolors(message, colors).replace(/\$\[fg\.color=[0-9A-Fa-f]{6} \]/g, ''));
|
||||
}}>
|
||||
generate!
|
||||
</button>
|
||||
</div>
|
||||
<span>{message()}</span>
|
||||
<code>{message()}</code>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -52,7 +52,12 @@ export function getmisskeycolors(message:string, colors:string[]){
|
|||
const [low, high , progress] = sampleFromArray(colors, i / (message.length - 1))
|
||||
//@ts-ignore
|
||||
const color = lerpoklab(tozerotoone(colors[low]), tozerotoone(colors[high]), progress)
|
||||
finalmessage += (`$[fg.color=${tohexstring(color).substring(1)} ${message[i]}]`)
|
||||
if (message[i] === " ") {
|
||||
finalmessage += " "
|
||||
} else {
|
||||
finalmessage += (`$[fg.color=${tohexstring(color).substring(1)} ${message[i]}]`)
|
||||
}
|
||||
|
||||
}
|
||||
return finalmessage
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue