Question: Example for getting custom colors
vzamanillo opened this issue · 2 comments
vzamanillo commented
Hey, thank you for this awesome package.
I am looking for examples of how to use custom colors that are not predefined in aurora, (orange, turquoise, etc...), could you please provide some example?.
Thanks!
logrusorgru commented
Hello.
May be Index
and BgIndex
is what you need. Also, check out README/8 bit colors paragraph.
But, the indices can't be used with Colorize method. Since, colors and indices are different. Actually, you can convert between Colors and indices using simple formulas. But underlying colors representations is not specified and can be changed in future versions.
For example
package main
import (
"fmt"
"github.com/logrusorgru/aurora"
)
func main() {
for i := uint8(16); i <= 231; i++ {
fmt.Println(i, aurora.Index(i, "pew-pew"), aurora.BgIndex(i, "pew-pew"))
}
}
vzamanillo commented
Thank you very much for your response.