automated snapshot
This commit is contained in:
@@ -76,7 +76,7 @@ type Actor struct {
|
|||||||
|
|
||||||
func (a *Actor) Draw() {
|
func (a *Actor) Draw() {
|
||||||
v := a.field.Get(a.position.X, a.position.Y)
|
v := a.field.Get(a.position.X, a.position.Y)
|
||||||
rad := rl.Remap(v, 0, 1, 0, 10*math.Pi)
|
rad := rl.Remap(v, 0, 1, 0, 5*math.Pi)
|
||||||
nextPosition := rl.Vector2{X: a.position.X + a.stepSize*float32(math.Cos(float64(rad))), Y: a.position.Y + a.stepSize*float32(math.Sin(float64(rad)))}
|
nextPosition := rl.Vector2{X: a.position.X + a.stepSize*float32(math.Cos(float64(rad))), Y: a.position.Y + a.stepSize*float32(math.Sin(float64(rad)))}
|
||||||
rl.DrawLineV(a.position, nextPosition, a.color)
|
rl.DrawLineV(a.position, nextPosition, a.color)
|
||||||
a.position = nextPosition
|
a.position = nextPosition
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ var (
|
|||||||
FlourescentColors = makeFlourescentColors()
|
FlourescentColors = makeFlourescentColors()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func Clamp(c rl.Color, min uint8, max uint8) rl.Color {
|
||||||
|
return rl.NewColor(
|
||||||
|
uint8(rl.Clamp(float32(c.R), float32(min), float32(max))),
|
||||||
|
uint8(rl.Clamp(float32(c.G), float32(min), float32(max))),
|
||||||
|
uint8(rl.Clamp(float32(c.B), float32(min), float32(max))),
|
||||||
|
uint8(rl.Clamp(float32(c.A), float32(min), float32(max))),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
func makeFlourescentColors() []rl.Color {
|
func makeFlourescentColors() []rl.Color {
|
||||||
fc := make([]rl.Color, len(FlourescentHues))
|
fc := make([]rl.Color, len(FlourescentHues))
|
||||||
for i, hue := range(FlourescentHues) {
|
for i, hue := range(FlourescentHues) {
|
||||||
|
|||||||
7
main.go
7
main.go
@@ -55,7 +55,8 @@ func main() {
|
|||||||
t0 := time.Now()
|
t0 := time.Now()
|
||||||
|
|
||||||
rng := rand.New(rand.NewSource(0))
|
rng := rand.New(rand.NewSource(0))
|
||||||
imageField := NewImageField("/home/d/Dropbox/art/data/david.png")
|
//imageField := NewImageField("/home/d/Dropbox/art/data/david.png")
|
||||||
|
imageField := NewImageField("/home/d/Dropbox/art/data/ramstatue.png")
|
||||||
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/Photo Dec 24 2025, 5 58 23 PM.jpg")
|
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/Photo Dec 24 2025, 5 58 23 PM.jpg")
|
||||||
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/andromeda.jpg")
|
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/andromeda.jpg")
|
||||||
//imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg")
|
//imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg")
|
||||||
@@ -86,8 +87,10 @@ func main() {
|
|||||||
hsv := rl.ColorToHSV(actorColor);
|
hsv := rl.ColorToHSV(actorColor);
|
||||||
hsv.Z *= 0.7
|
hsv.Z *= 0.7
|
||||||
actorColor = rl.ColorFromHSV(hsv.X, hsv.Y, hsv.Z)
|
actorColor = rl.ColorFromHSV(hsv.X, hsv.Y, hsv.Z)
|
||||||
actorColor.A = 50
|
actorColor = g.Clamp(actorColor, 10, 255)
|
||||||
|
actorColor.A = 10
|
||||||
//NewColor(11, 35, 176, 50),
|
//NewColor(11, 35, 176, 50),
|
||||||
|
|
||||||
//r
|
//r
|
||||||
contourLayer := NewContourLayer(&sketch, rng, field, actorColor)
|
contourLayer := NewContourLayer(&sketch, rng, field, actorColor)
|
||||||
sketch.AddLayer("contours", contourLayer)
|
sketch.AddLayer("contours", contourLayer)
|
||||||
|
|||||||
Reference in New Issue
Block a user