diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-12-17 13:57:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 13:57:44 -0500 |
commit | addb4ad9f27c74693638cf4d169be9e83ac4a752 (patch) | |
tree | 7db38fe9d4ea4fc92237cfcc8c7a4d59749ac9e5 /internal/switcher/misc.go | |
parent | 7938c2926338526390624a1f9004f6ad2699cd2b (diff) |
Copy hex escape sequences directly (#24)
Co-authored-by: Benjamin Chaussé <Benjamin.Chausse@goto.com>
Diffstat (limited to 'internal/switcher/misc.go')
-rw-r--r-- | internal/switcher/misc.go | 8 |
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" } |