code: func CountColor(color CHex, args ...interface{}) int {
  	var (
  		tolerance C.float = 0.01
  		bitmap    C.MMBitmapRef
  	)
  
  	if len(args) > 0 {
  		bitmap = args[0].(C.MMBitmapRef)
  	} else {
  		bitmap = CaptureScreen()
  	}
  
  	if len(args) > 1 {
  		tolerance = C.float(args[1].(float64))
  	}
  
  	count := C.bitmap_count_of_color(bitmap, C.MMRGBHex(color), tolerance)
  	if len(args) <= 0 {
  		FreeBitmap(bitmap)
  	}
  
  	return int(count)
  }
docs: // CountColor count bitmap color