func MakeShadeColor() *rr.Primitive { // Pick two random colors c, k := rand.Float64(), rand.Float64() // Pick random positions sx, sy, ex, ey := rand.Float64(), rand.Float64(), rand.Float64(), rand.Float64() name := fmt.Sprintf("EPH_%x-%x_%d-%d_%d-%d", int(c*255), int(k*255), int(sx*100), int(sy*100), int(ex*100), int(ey*100)) return rr.MakeTerminal(name, rr.LinShade(c, k, sx, sy, ex, ey)) }
func MakeDiagFill() *rr.Primitive { // Pick two random colors c, k := rand.Float64(), rand.Float64() // Pick a random diagonal d := rand.Intn(2) == 0 var name string if d { name = fmt.Sprintf("Df_%x-%x", int(c*255), int(k*255)) } else { name = fmt.Sprintf("dF_%x-%x", int(c*255), int(k*255)) } return rr.MakeTerminal(name, rr.DiagShade(c, k, d)) }
func MakeDiagLine() *rr.Primitive { // Pick random back/foreground colors b, f := rand.Float64(), rand.Float64() // Pick a random diagonal d := rand.Intn(2) == 0 // Pick a random line size s := rand.Intn(16) var name string if d { name = fmt.Sprintf("Dl_%x_%x-%x", int(s*15), int(b*255), int(f*255)) } else { name = fmt.Sprintf("dL_%x_%x-%x", int(s*15), int(b*255), int(f*255)) } return rr.MakeTerminal(name, rr.DiagLine(b, f, d, s)) }
func MakeFullColor() *rr.Primitive { c := rand.Float64() name := fmt.Sprintf("T_%d", int(c*255)) return rr.MakeTerminal(name, rr.Filler(c, c, c)) }