Skip to content

Instantly share code, notes, and snippets.

@Delta456
Created February 7, 2022 06:19
Show Gist options
  • Save Delta456/9c84de1403c22e135eaca525d3264b2c to your computer and use it in GitHub Desktop.
Save Delta456/9c84de1403c22e135eaca525d3264b2c to your computer and use it in GitHub Desktop.
Twitter Banner
package main
import (
"math"
"strings"
"github.com/Delta456/box-cli-maker/v2"
"github.com/gookit/color"
)
func main() {
Box := box.New(box.Config{Px: 2, Py: 1, Type: "Single", Color: uint(0x1d84f2), ContentAlign: "Center"})
Box.Print(lolcat("Swastik Baranwal"), lolcat(`Programmer | Open Source Contributor | FGO Gamer | Otaku
GitHub: https://github.com/Delta456
Dev.to: https://dev.to/delta456
Twitter: https//twitter.com/Delta2315
Deviant Art: https://deviantart.com/delta2318
`))
}
func lolcat(str string) string {
var Output string
Freq := float64(0.1)
for _, s := range strings.Split(str, "") {
Output += normalStyle(Freq, s)
Freq += 0.1
}
return Output
}
func normalStyle(num float64, s string) string {
Red := uint8(math.Sin(num+0)*127 + 128)
Green := uint8(math.Sin(num+2)*127 + 128)
Blue := uint8(math.Sin(num+4)*127 + 128)
return color.Rgb(Red, Blue, Green).Sprint(s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment