summaryrefslogtreecommitdiff
path: root/internal/switcher/misc.go
diff options
context:
space:
mode:
authorBenjamin Chaussé <Benjamin.Chausse@goto.com>2024-12-16 13:34:44 -0500
committerBenjamin Chaussé <Benjamin.Chausse@goto.com>2024-12-16 13:34:44 -0500
commit53d7cbf983420753e83a22e24aa8d19f413f3ff3 (patch)
tree7db38fe9d4ea4fc92237cfcc8c7a4d59749ac9e5 /internal/switcher/misc.go
parent7938c2926338526390624a1f9004f6ad2699cd2b (diff)
Copy hex escape sequences directlyesc-seq
Diffstat (limited to 'internal/switcher/misc.go')
-rw-r--r--internal/switcher/misc.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/switcher/misc.go b/internal/switcher/misc.go
index e87f219..d34a3bc 100644
--- a/internal/switcher/misc.go
+++ b/internal/switcher/misc.go
@@ -8,10 +8,6 @@ import (
"github.com/ChausseBenjamin/termpicker/internal/util"
)
-const (
- okCpMsg = "Copied %s to clipboard as %s"
-)
-
func (m Model) copyColor(format string) string {
pc := m.pickers[m.active].GetColor().ToPrecise()
switch format {
@@ -26,6 +22,10 @@ func (m Model) copyColor(format string) string {
case cpCMYK:
cmyk := colors.CMYK{}.FromPrecise(pc).(colors.CMYK)
return util.Copy(cmyk.String())
+ case cpEscFG:
+ return util.Copy(colors.EscapedSeq(m.pickers[m.active].GetColor(), true))
+ case cpEscBG:
+ return util.Copy(colors.EscapedSeq(m.pickers[m.active].GetColor(), false))
default:
return "Copy format not supported"
}