cleaning up, early http server draft

This commit is contained in:
2026-01-24 09:39:27 +03:00
parent d52658ab5c
commit cc5c9c6d1a
23 changed files with 123 additions and 0 deletions

39
pkg/negate/minus19blue.go Normal file
View File

@@ -0,0 +1,39 @@
//go:build ignore
package main
import (
"image"
"image/color"
"image/png"
"os"
)
type Reshade struct{ image.Image }
func (rs Reshade) ColorModel() color.Model { return rs.Image.ColorModel() }
func (rs Reshade) Bounds() image.Rectangle { return rs.Image.Bounds() }
func (rs Reshade) At(x, y int) color.Color {
c := rs.Image.At(x, y)
r, g, b, a := c.RGBA()
// minus 19 blue
return color.RGBA{
uint8(r >> 8),
uint8(g >> 8),
uint8(b>>8) - 8*8,
uint8(a >> 8),
}
}
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
img, err := png.Decode(os.Stdin)
check(err)
err = png.Encode(os.Stdout, Reshade{img})
check(err)
}