|
|
@ -4,6 +4,7 @@ import ( |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"git.aiterp.net/lucifer/new-server/app/client" |
|
|
|
"git.aiterp.net/lucifer/new-server/internal/color" |
|
|
|
"git.aiterp.net/lucifer/new-server/models" |
|
|
|
"log" |
|
|
|
"os" |
|
|
@ -92,6 +93,29 @@ func main() { |
|
|
|
|
|
|
|
WriteDeviceInfoTable(os.Stdout, devices) |
|
|
|
} |
|
|
|
case "color": |
|
|
|
{ |
|
|
|
col, err := color.Parse(cmd.Params.Get(0).StringOr("hs:0,0")) |
|
|
|
if err != nil { |
|
|
|
log.Fatalln(err) |
|
|
|
} |
|
|
|
|
|
|
|
if col.IsKelvin() { |
|
|
|
fmt.Println(col.String()) |
|
|
|
} |
|
|
|
if hs, ok := col.ToHS(); ok { |
|
|
|
fmt.Println(hs.String()) |
|
|
|
} |
|
|
|
if hsk, ok := col.ToHSK(); ok { |
|
|
|
fmt.Println(hsk.String()) |
|
|
|
} |
|
|
|
if xy, ok := col.ToXY(); ok { |
|
|
|
fmt.Println(xy.String()) |
|
|
|
} |
|
|
|
if rgb, ok := col.ToRGB(); ok { |
|
|
|
fmt.Println(rgb.String()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
case "factory": |
|
|
|
factoryCmd(ctx, c) |
|
|
|