Code to convert image at path into cached RGBA data

This commit is contained in:
Kovid Goyal
2024-07-22 21:38:13 +05:30
parent 1b6f74da65
commit fb20c4acb6
4 changed files with 283 additions and 0 deletions

View File

@@ -310,3 +310,10 @@ func FunctionName(a any) string {
}
return ""
}
func Abs[T constraints.Integer](x T) T {
if x < 0 {
return -x
}
return x
}