diff --git a/aztec/encoder.go b/aztec/encoder.go index a7ebc50..a63650d 100644 --- a/aztec/encoder.go +++ b/aztec/encoder.go @@ -127,7 +127,7 @@ func Encode(data []byte, minECCPercent int, userSpecifiedLayers int) (barcode.Ba return EncodeWithColor(data, minECCPercent, userSpecifiedLayers, barcode.ColorScheme16) } -// Encode returns an aztec barcode with the given content +// Encode returns an aztec barcode with the given content and color scheme func EncodeWithColor(data []byte, minECCPercent int, userSpecifiedLayers int, color barcode.ColorScheme) (barcode.Barcode, error) { bits := highlevelEncode(data) eccBits := ((bits.Len() * minECCPercent) / 100) + 11 diff --git a/codabar/encoder.go b/codabar/encoder.go index beb0e0e..74689d0 100644 --- a/codabar/encoder.go +++ b/codabar/encoder.go @@ -32,7 +32,7 @@ var encodingTable = map[rune][]bool{ 'D': []bool{true, false, true, false, false, true, true, false, false, true}, } -// Encode creates a codabar barcode for the given content +// Encode creates a codabar barcode for the given content and color scheme func EncodeWithColor(content string, color barcode.ColorScheme) (barcode.Barcode, error) { checkValid, _ := regexp.Compile(`[ABCD][0123456789\-\$\:/\.\+]*[ABCD]$`) if content == "!" || checkValid.ReplaceAllString(content, "!") != "!" { diff --git a/code128/encode.go b/code128/encode.go index 7c3a9a3..3e1b646 100644 --- a/code128/encode.go +++ b/code128/encode.go @@ -155,7 +155,7 @@ func getCodeIndexList(content []rune) *utils.BitList { return result } -// Encode creates a Code 128 barcode for the given content +// Encode creates a Code 128 barcode for the given content and color scheme func EncodeWithColor(content string, color barcode.ColorScheme) (barcode.BarcodeIntCS, error) { contentRunes := strToRunes(content) if len(contentRunes) <= 0 || len(contentRunes) > 80 { diff --git a/code39/encoder.go b/code39/encoder.go index 5607615..f474173 100644 --- a/code39/encoder.go +++ b/code39/encoder.go @@ -111,7 +111,7 @@ func prepare(content string) (string, error) { return result, nil } -// Encode returns a code39 barcode for the given content +// Encode returns a code39 barcode for the given content and color scheme // if includeChecksum is set to true, a checksum character is calculated and added to the content func EncodeWithColor(content string, includeChecksum bool, fullASCIIMode bool, color barcode.ColorScheme) (barcode.BarcodeIntCS, error) { if fullASCIIMode { diff --git a/code93/encoder.go b/code93/encoder.go index ff5f4b4..27140c3 100644 --- a/code93/encoder.go +++ b/code93/encoder.go @@ -74,6 +74,8 @@ func prepare(content string) (string, error) { return result, nil } +// Encode returns a code93 barcode for the given content and color scheme +// if includeChecksum is set to true, two checksum characters are calculated and added to the content func EncodeWithColor(content string, includeChecksum bool, fullASCIIMode bool, color barcode.ColorScheme) (barcode.Barcode, error) { if fullASCIIMode { var err error diff --git a/datamatrix/encoder.go b/datamatrix/encoder.go index f3b1418..9501bee 100644 --- a/datamatrix/encoder.go +++ b/datamatrix/encoder.go @@ -7,7 +7,7 @@ import ( "github.com/boombuler/barcode" ) -// Encode returns a Datamatrix barcode for the given content +// Encode returns a Datamatrix barcode for the given content and color scheme func EncodeWithColor(content string, color barcode.ColorScheme) (barcode.Barcode, error) { data := encodeText(content) diff --git a/ean/encoder.go b/ean/encoder.go index f3e7af2..4a80706 100644 --- a/ean/encoder.go +++ b/ean/encoder.go @@ -157,7 +157,7 @@ func encodeEAN13(code string) *utils.BitList { return result } -// Encode returns a EAN 8 or EAN 13 barcode for the given code +// Encode returns a EAN 8 or EAN 13 barcode for the given code and color scheme func EncodeWithColor(code string, color barcode.ColorScheme) (barcode.BarcodeIntCS, error) { var checkSum int if len(code) == 7 || len(code) == 12 { diff --git a/pdf417/encoder.go b/pdf417/encoder.go index a6c4310..3425ac7 100644 --- a/pdf417/encoder.go +++ b/pdf417/encoder.go @@ -12,7 +12,7 @@ const ( padding_codeword = 900 ) -// Encodes the given data as PDF417 barcode. +// Encodes the given data and color scheme as PDF417 barcode. // securityLevel should be between 0 and 8. The higher the number, the more // additional error-correction codes are added. func EncodeWithColor(data string, securityLevel byte, color barcode.ColorScheme) (barcode.Barcode, error) { diff --git a/qr/encoder.go b/qr/encoder.go index 937c46e..81ceb88 100644 --- a/qr/encoder.go +++ b/qr/encoder.go @@ -54,7 +54,7 @@ func (e Encoding) String() string { return "" } -// Encode returns a QR barcode with the given content, error correction level and uses the given encoding +// Encode returns a QR barcode with the given content and color scheme, error correction level and uses the given encoding func EncodeWithColor(content string, level ErrorCorrectionLevel, mode Encoding, color barcode.ColorScheme) (barcode.Barcode, error) { bits, vi, err := mode.getEncoder()(content, level) if err != nil {