mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
Add experimental support for 24-bit colors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -121,6 +122,13 @@ type ColorPair struct {
|
||||
id int16
|
||||
}
|
||||
|
||||
func HexToColor(rrggbb string) Color {
|
||||
r, _ := strconv.ParseInt(rrggbb[1:3], 16, 0)
|
||||
g, _ := strconv.ParseInt(rrggbb[3:5], 16, 0)
|
||||
b, _ := strconv.ParseInt(rrggbb[5:7], 16, 0)
|
||||
return Color((1 << 24) + (r << 16) + (g << 8) + b)
|
||||
}
|
||||
|
||||
func NewColorPair(fg Color, bg Color) ColorPair {
|
||||
return ColorPair{fg, bg, -1}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user