refactorings + basis of script editor.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.aiterp.net/lucifer3/server/internal/color"
|
||||
"image"
|
||||
color2 "image/color"
|
||||
"image/png"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
img := image.NewRGBA(image.Rect(0, 0, 500, 500))
|
||||
for y := 0; y < 500; y += 1 {
|
||||
for x := 0; x < 500; x += 1 {
|
||||
rgb := (color.XY{X: float64(x) / 499, Y: float64(y) / 499}).ToRGB()
|
||||
|
||||
if y == 300 {
|
||||
log.Println(rgb.Red, rgb.Green, rgb.Blue)
|
||||
}
|
||||
|
||||
img.Set(x, y, color2.RGBA{
|
||||
R: uint8(rgb.Red * 255.0),
|
||||
G: uint8(rgb.Green * 255.0),
|
||||
B: uint8(rgb.Blue * 255.0),
|
||||
A: 255,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
_ = png.Encode(os.Stdout, img)
|
||||
}
|
||||
Reference in New Issue
Block a user