Compare commits

..

2 commits

Author SHA1 Message Date
amy
4935439056
Merge remote-tracking branch 'refs/remotes/origin/main'
All checks were successful
Build / Build (push) Successful in 1m16s
Build / Deploy (push) Successful in 11s
2024-12-12 21:56:18 +03:30
amy
4e5c17511c
fix spaces 2024-12-12 21:55:14 +03:30
2 changed files with 8 additions and 3 deletions

View file

@ -59,12 +59,12 @@ function App() {
} }
// @ts-ignore // @ts-ignore
let message = document.getElementById("ubuntucola").value as string 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! generate!
</button> </button>
</div> </div>
<span>{message()}</span> <code>{message()}</code>
</div> </div>
</> </>
) )

View file

@ -52,7 +52,12 @@ export function getmisskeycolors(message:string, colors:string[]){
const [low, high , progress] = sampleFromArray(colors, i / (message.length - 1)) const [low, high , progress] = sampleFromArray(colors, i / (message.length - 1))
//@ts-ignore //@ts-ignore
const color = lerpoklab(tozerotoone(colors[low]), tozerotoone(colors[high]), progress) 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 return finalmessage
} }