You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: convert.go
    path of file: ./repos/lazygit/vendor/github.com/gookit/color
    
    the code of the file until where you have to start completion: package color

import (
	"fmt"
	"math"
	"strconv"
	"strings"
)

var (
	// ---------- basic(16) <=> 256 color convert ----------
	basicTo256Map = map[uint8]uint8{
		30: 0,   // black 	000000
		31: 
    
func Rgb2basic(r, g, b uint8, isBg bool) uint8 {
	// is basic color, direct use static map data.
	hex := RgbToHex([]int{int(r), int(g), int(b)})
	if val, ok := hex2basicMap[hex]; ok {
		if isBg {
			return val + 10
		}
		return val
	}

	return RgbToAnsi(r, g, b, isBg)
}