1
0
Fork 0

Adding render/palette.go

This commit is contained in:
Henrik Hautakoski 2025-06-25 22:15:36 +02:00
parent 575791cfc1
commit 0364f6ca9e

15
render/palette.go Normal file
View file

@ -0,0 +1,15 @@
package render
import "github.com/pnx/go-raytracer/graphics"
func DrawPalette(ctx *graphics.Context, w, h int32) {
y := int32(0)
for i := range int32(255) {
if i > 0 && (i%0x10) == 0 {
y += 1
}
ctx.DrawRect(int32((i%0x10)*w), int32(y*h), int32(w), int32(h), byte(i))
}
}