From 53d7cbf983420753e83a22e24aa8d19f413f3ff3 Mon Sep 17 00:00:00 2001 From: Benjamin Chaussé Date: Mon, 16 Dec 2024 13:34:44 -0500 Subject: Copy hex escape sequences directly --- internal/switcher/misc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/switcher/misc.go') 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" } -- cgit v1.2.3