(content string, color barcode.ColorScheme)
| 193 | } |
| 194 | |
| 195 | func EncodeWithoutChecksumWithColor(content string, color barcode.ColorScheme) (barcode.Barcode, error) { |
| 196 | contentRunes := strToRunes(content) |
| 197 | if len(contentRunes) <= 0 || len(contentRunes) > 80 { |
| 198 | return nil, fmt.Errorf("content length should be between 1 and 80 runes but got %d", len(contentRunes)) |
| 199 | } |
| 200 | idxList := getCodeIndexList(contentRunes) |
| 201 | |
| 202 | if idxList == nil { |
| 203 | return nil, fmt.Errorf("\"%s\" could not be encoded", content) |
| 204 | } |
| 205 | |
| 206 | result := new(utils.BitList) |
| 207 | for _, idx := range idxList.GetBytes() { |
| 208 | result.AddBit(encodingTable[idx]...) |
| 209 | } |
| 210 | result.AddBit(encodingTable[stopSymbol]...) |
| 211 | return utils.New1DCodeWithColor(barcode.TypeCode128, content, result, color), nil |
| 212 | } |
no test coverage detected