initial commit
This commit is contained in:
19
model_color.go
Normal file
19
model_color.go
Normal file
@ -0,0 +1,19 @@
|
||||
package niri
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
"math"
|
||||
)
|
||||
|
||||
type niriColor struct {
|
||||
RGB [3]float64 `json:"rgb"`
|
||||
}
|
||||
|
||||
func (c niriColor) AsColor() color.Color {
|
||||
return color.NRGBA64{
|
||||
R: uint16(c.RGB[0] * math.MaxUint16),
|
||||
G: uint16(c.RGB[1] * math.MaxUint16),
|
||||
B: uint16(c.RGB[2] * math.MaxUint16),
|
||||
A: math.MaxUint16,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user