2 Star 0 Fork 0

hero/momo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
canvas.go 634 Bytes
一键复制 编辑 原始数据 按行查看 历史
hero 提交于 2024-08-01 15:51 . upd:captcha移动到rbac模块下
/**
* @Author Awen
* @Date 2024/06/01
* @Email wengaolng@gmail.com
**/
package canvas
import (
"image"
"image/color"
)
// CreatePaletteCanvas is the canvas that creates the palette
func CreatePaletteCanvas(width, height int, colour []color.RGBA) Palette {
p := []color.Color{
color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0x00},
}
for _, co := range colour {
p = append(p, co)
}
return NewPalette(image.Rect(0, 0, width, height), p)
}
// CreateNRGBACanvas is the canvas that creates the NRGBA
func CreateNRGBACanvas(width, height int, isAlpha bool) NRGBA {
return NewNRGBA(image.Rect(0, 0, width, height), isAlpha)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/linqwen/momo.git
git@gitee.com:linqwen/momo.git
linqwen
momo
momo
v1.7.4

搜索帮助