mirror of
https://github.com/felixangell/phi.git
synced 2024-08-16 11:10:37 +03:00
removed gfx package due to strife updates
This commit is contained in:
parent
d6002d7513
commit
39c7d19bf3
38
gfx/col.go
38
gfx/col.go
@ -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}
|
||||
}
|
BIN
phi-editor
BIN
phi-editor
Binary file not shown.
Loading…
Reference in New Issue
Block a user