removed gfx package due to strife updates

This commit is contained in:
Felix Angell 2018-04-14 02:19:33 +01:00
parent d6002d7513
commit 39c7d19bf3
2 changed files with 0 additions and 38 deletions

View File

@ -1,38 +0,0 @@
package gfx
import (
"github.com/veandco/go-sdl2/sdl"
"strconv"
)
func SetDrawColorHexString(ctx *sdl.Renderer, col string) {
colour, err := strconv.ParseUint(col, 0, 32)
if err != nil {
colour = 0
}
SetDrawColorHex(ctx, uint32(colour))
}
func SetDrawColorHex(ctx *sdl.Renderer, col uint32) {
a := uint8(255)
r := uint8(col & 0xff0000 >> 16)
g := uint8(col & 0xff00 >> 8)
b := uint8(col & 0xff)
ctx.SetDrawColor(r, g, b, a)
}
func HexColorString(col string) sdl.Color {
colour, err := strconv.ParseUint(col, 0, 32)
if err != nil {
return sdl.Color{}
}
return HexColor(uint32(colour))
}
func HexColor(col uint32) sdl.Color {
a := uint8(255)
r := uint8(col & 0xff0000 >> 16)
g := uint8(col & 0xff00 >> 8)
b := uint8(col & 0xff)
return sdl.Color{r, g, b, a}
}

Binary file not shown.