2018-08-03 06:46:10 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2018-09-22 14:23:26 +00:00
|
|
|
"opslag.de/schobers/zntg/allg5"
|
2018-08-03 06:46:10 +00:00
|
|
|
)
|
|
|
|
|
2018-09-22 14:23:26 +00:00
|
|
|
var dropShadowPalette []allg5.Color
|
2018-08-03 06:46:10 +00:00
|
|
|
|
|
|
|
func initDropShadowPalette() {
|
|
|
|
if nil != dropShadowPalette {
|
|
|
|
return
|
|
|
|
}
|
2018-09-22 14:23:26 +00:00
|
|
|
dropShadowPalette = []allg5.Color{
|
|
|
|
allg5.NewColorAlpha(0, 0, 0, 0x0f),
|
|
|
|
allg5.NewColorAlpha(0, 0, 0, 0x07),
|
|
|
|
allg5.NewColorAlpha(0, 0, 0, 0x03),
|
2018-08-03 06:46:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func DropShadow(x1, y1, x2, y2 float32) {
|
|
|
|
initDropShadowPalette()
|
|
|
|
|
2018-09-22 14:23:26 +00:00
|
|
|
allg5.DrawLine(x1, y2+1, x2+1, y2+1, dropShadowPalette[0], 1)
|
|
|
|
allg5.DrawLine(x2+1, y1, x2+1, y2, dropShadowPalette[0], 1)
|
|
|
|
allg5.DrawLine(x1, y2+2, x2+2, y2+2, dropShadowPalette[1], 1)
|
|
|
|
allg5.DrawLine(x2+2, y1, x2+2, y2+1, dropShadowPalette[1], 1)
|
|
|
|
allg5.DrawLine(x1+1, y2+3, x2+2, y2+3, dropShadowPalette[2], 1)
|
|
|
|
allg5.DrawLine(x2+3, y1+1, x2+3, y2+2, dropShadowPalette[2], 1)
|
2018-08-03 06:46:10 +00:00
|
|
|
}
|