Skip to content

Commit a8d69d1

Browse files
committed
release new version 3.5.4
Fix the error of colorLight in PNG format.
1 parent 156ab69 commit a8d69d1

File tree

5 files changed

+168
-162
lines changed

5 files changed

+168
-162
lines changed

demo/demo_node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var config3={
7979
subTitle: 'nodejs', // Subtitle content
8080
subTitleFont: "20px Arial", // Subtitle font
8181
subTitleColor: "#269926", // Subtitle color
82-
subTitleTop: 40, // Subtitle drwa position(Y coordinate), default is 50
82+
subTitleTop: 50, // Subtitle drwa position(Y coordinate), default is 50
8383

8484
// === Posotion Pattern(Eye) Color
8585
PI: '#BF3030',

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* NodeJS QRCode generator. Save image to file. Support Dot style, Logo, Background image, Colorful, Title, etc.(Running without DOM on server side)
55
*
6-
* Version 3.5.2
6+
* Version 3.5.4
77
*
88
* @author [ [email protected] ]
99
*
@@ -1118,7 +1118,11 @@ Drawing.prototype.draw = function(oQRCode) {
11181118

11191119
_oContext.fillStyle = "#ffffff";
11201120
_oContext.fillRect(0, 0, this._canvas.width, this._canvas.height);
1121-
}
1121+
}else{
1122+
_oContext.lineWidth = 0;
1123+
_oContext.fillStyle = this._htOption.colorLight;
1124+
_oContext.fillRect(0, 0, this._canvas.width, this._canvas.height);
1125+
}
11221126

11231127

11241128
var t = this;

index.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyqrcodejs-nodejs",
3-
"version": "3.5.2",
3+
"version": "3.5.4",
44
"description": "NodeJS QRCode generator. Support Dot style, Logo, Background image, Colorful, Title, etc.",
55
"main": "index.min.js",
66
"scripts": {},

readme.md

Lines changed: 158 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
66

77
## Table of contents
88

9+
- [Table of contents](#table-of-contents)
910
- [Choose what you need](#choose-what-you-need)
1011
- [Feature](#feature)
1112
- [Try It!](#try-it)
@@ -14,8 +15,9 @@ EasyQRCodeJS-NodeJS 是一个 NodeJS 环境下的服务端 JavaScript QRCode 图
1415
- [Installation](#installation)
1516
- [Basic Usages](#basic-usages)
1617
- [QRCode API](#qrcode-api)
17-
- [Object](#object)
18-
- [Methods](#methods)
18+
- [Object](#object)
19+
- [Options](#options)
20+
- [Methods](#methods)
1921
- [License](#license)
2022
- [EasyQRCodeJS-NodeJS-Premium](#easyqrcodejs-nodejs-premium)
2123
- [End](#end)
@@ -128,163 +130,163 @@ var qrcode = new QRCode(options);
128130
```
129131

130132

131-
- Options
133+
### Options
132134

133-
```JS
134-
var options = {
135-
// ====== Basic
136-
text: "https://github.com/ushelp/EasyQRCodeJS",
137-
width: 256,
138-
height: 256,
139-
colorDark : "#000000",
140-
colorLight : "#ffffff",
141-
correctLevel : QRCode.CorrectLevel.H, // L, M, Q, H
142-
dotScale: 1 // Must be greater than 0, less than or equal to 1. default is 1
143-
144-
// ====== Quiet Zone
145-
/*
146-
quietZone: 0,
147-
quietZoneColor: 'transparent',
148-
*/
149-
150-
// ====== Logo
151-
/*
152-
logo:"../demo/logo.png", // Relative address, relative to `easy.qrcode.min.js`
153-
logo:"http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png",
154-
logoWidth:80, // widht. default is automatic width
155-
logoHeight:80 // height. default is automatic height
156-
logoBackgroundColor:'#fffff', // Logo backgroud color, Invalid when `logBgTransparent` is true; default is '#ffffff'
157-
logoBackgroundTransparent:false, // Whether use transparent image, default is false
158-
*/
135+
```JS
136+
var options = {
137+
// ====== Basic
138+
text: "https://github.com/ushelp/EasyQRCodeJS",
139+
width: 256,
140+
height: 256,
141+
colorDark : "#000000",
142+
colorLight : "#ffffff",
143+
correctLevel : QRCode.CorrectLevel.H, // L, M, Q, H
144+
dotScale: 1 // Must be greater than 0, less than or equal to 1. default is 1
159145

160-
// ====== Backgroud Image
161-
/*
162-
backgroundImage: '', // Background Image
163-
backgroundImageAlpha: 1, // Background image transparency, value between 0 and 1. default is 1.
164-
autoColor: false,
165-
*/
166-
167-
// ====== Colorful
168-
// === Posotion Pattern(Eye) Color
169-
/*
170-
PO: '#e1622f', // Global Posotion Outer color. if not set, the defaut is `colorDark`
171-
PI: '#aa5b71', // Global Posotion Inner color. if not set, the defaut is `colorDark`
172-
PO_TL:'', // Posotion Outer color - Top Left
173-
PI_TL:'', // Posotion Inner color - Top Left
174-
PO_TR:'', // Posotion Outer color - Top Right
175-
PI_TR:'', // Posotion Inner color - Top Right
176-
PO_BL:'', // Posotion Outer color - Bottom Left
177-
PI_BL:'', // Posotion Inner color - Bottom Left
178-
*/
179-
// === Alignment Color
180-
/*
181-
AO: '', // Alignment Outer. if not set, the defaut is `colorDark`
182-
AI: '', // Alignment Inner. if not set, the defaut is `colorDark`
183-
*/
184-
// === Timing Pattern Color
185-
/*
186-
timing: '#e1622f', // Global Timing color. if not set, the defaut is `colorDark`
187-
timing_H: '', // Horizontal timing color
188-
timing_V: '', // Vertical timing color
189-
*/
190-
191-
// ====== Title
192-
/*
193-
title: 'QR Title', // content
194-
titleFont: "bold 18px Arial", //font. default is "bold 16px Arial"
195-
titleColor: "#004284", // color. default is "#000"
196-
titleBackgroundColor: "#fff", // background color. default is "#fff"
197-
titleHeight: 70, // height, including subTitle. default is 0
198-
titleTop: 25, // draws y coordinates. default is 30
199-
*/
200-
201-
// ====== SubTitle
202-
/*
203-
subTitle: 'QR subTitle', // content
204-
subTitleFont: "14px Arial", // font. default is "14px Arial"
205-
subTitleColor: "#004284", // color. default is "4F4F4F"
206-
subTitleTop: 40, // draws y coordinates. default is 0
207-
*/
208-
209-
// ===== Event Handler
210-
/*
211-
onRenderingStart: undefined,
212-
*/
213-
214-
// ==== Images format
215-
/*
216-
format: 'PNG', // 'PNG', 'JPG'
217-
compressionLevel: 6, // ZLIB compression level (0-9). default is 6
218-
quality: 0.75, // An object specifying the quality (0 to 1). default is 0.75. (JPGs only)
219-
*/
220-
221-
// ==== Versions
222-
/*
223-
version: 0 // The symbol versions of QR Code range from Version 1 to Version 40. default 0 means automatically choose the closest version based on the text length.
224-
225-
*/
226-
}
227-
```
146+
// ====== Quiet Zone
147+
/*
148+
quietZone: 0,
149+
quietZoneColor: 'transparent',
150+
*/
151+
152+
// ====== Logo
153+
/*
154+
logo:"../demo/logo.png", // Relative address, relative to `easy.qrcode.min.js`
155+
logo:"http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png",
156+
logoWidth:80, // widht. default is automatic width
157+
logoHeight:80 // height. default is automatic height
158+
logoBackgroundColor:'#fffff', // Logo backgroud color, Invalid when `logBgTransparent` is true; default is '#ffffff'
159+
logoBackgroundTransparent:false, // Whether use transparent image, default is false
160+
*/
161+
162+
// ====== Backgroud Image
163+
/*
164+
backgroundImage: '', // Background Image
165+
backgroundImageAlpha: 1, // Background image transparency, value between 0 and 1. default is 1.
166+
autoColor: false,
167+
*/
168+
169+
// ====== Colorful
170+
// === Posotion Pattern(Eye) Color
171+
/*
172+
PO: '#e1622f', // Global Posotion Outer color. if not set, the defaut is `colorDark`
173+
PI: '#aa5b71', // Global Posotion Inner color. if not set, the defaut is `colorDark`
174+
PO_TL:'', // Posotion Outer color - Top Left
175+
PI_TL:'', // Posotion Inner color - Top Left
176+
PO_TR:'', // Posotion Outer color - Top Right
177+
PI_TR:'', // Posotion Inner color - Top Right
178+
PO_BL:'', // Posotion Outer color - Bottom Left
179+
PI_BL:'', // Posotion Inner color - Bottom Left
180+
*/
181+
// === Alignment Color
182+
/*
183+
AO: '', // Alignment Outer. if not set, the defaut is `colorDark`
184+
AI: '', // Alignment Inner. if not set, the defaut is `colorDark`
185+
*/
186+
// === Timing Pattern Color
187+
/*
188+
timing: '#e1622f', // Global Timing color. if not set, the defaut is `colorDark`
189+
timing_H: '', // Horizontal timing color
190+
timing_V: '', // Vertical timing color
191+
*/
192+
193+
// ====== Title
194+
/*
195+
title: 'QR Title', // content
196+
titleFont: "bold 18px Arial", //font. default is "bold 16px Arial"
197+
titleColor: "#004284", // color. default is "#000"
198+
titleBackgroundColor: "#fff", // background color. default is "#fff"
199+
titleHeight: 70, // height, including subTitle. default is 0
200+
titleTop: 25, // draws y coordinates. default is 30
201+
*/
202+
203+
// ====== SubTitle
204+
/*
205+
subTitle: 'QR subTitle', // content
206+
subTitleFont: "14px Arial", // font. default is "14px Arial"
207+
subTitleColor: "#004284", // color. default is "4F4F4F"
208+
subTitleTop: 40, // draws y coordinates. default is 0
209+
*/
210+
211+
// ===== Event Handler
212+
/*
213+
onRenderingStart: undefined,
214+
*/
215+
216+
// ==== Images format
217+
/*
218+
format: 'PNG', // 'PNG', 'JPG'
219+
compressionLevel: 6, // ZLIB compression level (0-9). default is 6
220+
quality: 0.75, // An object specifying the quality (0 to 1). default is 0.75. (JPGs only)
221+
*/
222+
223+
// ==== Versions
224+
/*
225+
version: 0 // The symbol versions of QR Code range from Version 1 to Version 40. default 0 means automatically choose the closest version based on the text length.
226+
227+
*/
228+
}
229+
```
228230

229-
| Option | Required | Type | Defaults | Description |
230-
| --- | --- |--- | --- |--- |
231-
| Basic options| --- | ---|---|---|
232-
| **text** | Y | String |`''` | Text |
233-
| **width** | N | Number | `256` | Width |
234-
| **height** | N | Number | `256` | Height |
235-
| **colorDark** | N | String | `#000000` | Dark CSS color |
236-
| **colorLight** | N | String | `#ffffff` | Light CSS color |
237-
| **correctLevel** | N | Enum | `QRCode.CorrectLevel.H` | `QRCode.CorrectLevel.H`<br/>`QRCode.CorrectLevel.Q` <br/> `QRCode.CorrectLevel.M` <br/> `QRCode.CorrectLevel.L`|
238-
| **dotScale** | N | Number | `1.0` |Dot style required Patterns. Ranges: `0-1.0` |
239-
| Quiet Zone| --- | ---|---|---|
240-
| **quietZone** | N | Number | `0` | Quiet Zone size |
241-
| **quietZoneColor** | N | String | `transparent` | Background CSS color to Quiet Zone |
242-
| Logo options| --- | ---|---|---|
243-
| **logo** | N | String | `undefined` | Logo Image Path or Base64 encoded image. If use relative address, relative to `easy.qrcode.min.js` |
244-
| **logoWidth** | N | Number | `undefined` | Height |
245-
| **logoHeight** | N | Number | `undefined` | Width |
246-
| **logoBackgroundTransparent** | N | Boolean | `false` | Whether the background transparent image(`PNG`) shows transparency. When `true`, `logoBackgroundColor` is invalid |
247-
| **logoBackgroundColor** | N | String | `#ffffff` | Set Background CSS Color when image background transparent. Valid when `logoBackgroundTransparent` is `false` |
248-
| Backgroud Image options| ---|--- |---|---|
249-
| **backgroundImage** | N | String | `undefined` | Background Image Path or Base64 encoded image. If use relative address, relative to `easy.qrcode.min.js` |
250-
| **backgroundImageAlpha** | N | Number | `1.0` | Background image transparency. Ranges: `0-1.0` |
251-
| **autoColor** | N | Boolean | `false` | Automatic color adjustment |
252-
| Posotion Pattern Color options| --- | ---|---|---|
253-
| **PO** | N | String | `undefined` | Global Posotion Outer CSS color. if not set, the defaut is `colorDark` |
254-
| **PI** | N | String | `undefined` | Global Posotion Inner CSS color. if not set, the defaut is `colorDark` |
255-
| **PO_TL** | N | String | `undefined` | Posotion Outer CSS color - Top Left |
256-
| **PI_TL** | N | String | `undefined` | Posotion Inner CSS color - Top Left |
257-
| **PO_TR** | N | String | `undefined` | Posotion Outer CSS color - Top Right |
258-
| **PI_TR** | N | String | `undefined` | Posotion Inner CSS color - Top Right |
259-
| **PO_BL** | N | String | `undefined` | Posotion Outer CSS color - Bottom Left |
260-
| **PI_BL** | N | String | `undefined` | Posotion Inner CSS color - Bottom Left |
261-
| Alignment Color options| --- |--- |---|---|
262-
| **AO** | N | String | `undefined` | Alignment Outer CSS color. if not set, the defaut is `colorDark` |
263-
| **AI** | N | String | `undefined` | Alignment Inner CSS color. if not set, the defaut is `colorDark` |
264-
| Timing Pattern Color options| --- | ---|---|---|
265-
| **timing** | N | String | `undefined` | Global Timing CSS color. if not set, the defaut is `colorDark` |
266-
| **timing_H** | N | String | `undefined` | Horizontal timing CSS color |
267-
| **timing_V** | N | String | `undefined` | Vertical timing CSS color |
268-
| Title options| --- | ---|---|---|
269-
| **title** | N | String | `''` | |
270-
| **titleFont** | N | String | `bold 16px Arial` | CSS Font |
271-
| **titleColor** | N | String | `#000000` | CSS color |
272-
| **titleBackgroundColor** | N | String | `#ffffff` | CSS color|
273-
| **titleHeight** | N | Number | `0` | Title Height, Include subTitle |
274-
| **titleTop** | N | Number | `30` | draws y coordinates.|
275-
| SubTitle options| --- | ---|---|---|
276-
| **subTitle** | N | String | `''` | |
277-
| **subTitleFont** | N | String | `14px Arial` | CSS Font |
278-
| **subTitleColor** | N | String | `#4F4F4F` | CSS color |
279-
| **subTitleTop** | N | Number | `0` | draws y coordinates. default is 0|
280-
| Event Handler options| --- | ---|---|---|
281-
| **onRenderingStart(qrCodeOptions)** | N | Function | `undefined` | Callback function when rendering start work. can use to hide loading state or handling. |
282-
| Images format options| --- | ---|---|---|
283-
| **format** | N | String | `PNG` | 'PNG' or 'JPG' |
284-
| **compressionLevel** | N | Number | `6` | ZLIB compression level between 0 and 9. (**PNGs only**) |
285-
| **quality** | N | Number | `0.75` | An object specifying the quality (0 to 1). (**JPGs only**) |
286-
| Version options| --- | ---|---|---|
287-
| **version** | N | Number | `0` | The symbol versions of QR Code range from Version `1` to Version `40`. default 0 means automatically choose the closest version based on the text length. [Information capacity and versions of QR Codes](https://www.qrcode.com/en/about/version.html) **NOTE**: If you set a value less than the minimum version available for text, the minimum version is automatically used. |
231+
| Option | Required | Type | Defaults | Description |
232+
| --- | --- |--- | --- |--- |
233+
| Basic options| --- | ---|---|---|
234+
| **text** | Y | String |`''` | Text |
235+
| **width** | N | Number | `256` | Width |
236+
| **height** | N | Number | `256` | Height |
237+
| **colorDark** | N | String | `#000000` | Dark CSS color |
238+
| **colorLight** | N | String | `#ffffff` | Light CSS color |
239+
| **correctLevel** | N | Enum | `QRCode.CorrectLevel.H` | `QRCode.CorrectLevel.H`<br/>`QRCode.CorrectLevel.Q` <br/> `QRCode.CorrectLevel.M` <br/> `QRCode.CorrectLevel.L`|
240+
| **dotScale** | N | Number | `1.0` |Dot style required Patterns. Ranges: `0-1.0` |
241+
| Quiet Zone| --- | ---|---|---|
242+
| **quietZone** | N | Number | `0` | Quiet Zone size |
243+
| **quietZoneColor** | N | String | `transparent` | Background CSS color to Quiet Zone |
244+
| Logo options| --- | ---|---|---|
245+
| **logo** | N | String | `undefined` | Logo Image Path or Base64 encoded image. If use relative address, relative to `easy.qrcode.min.js` |
246+
| **logoWidth** | N | Number | `undefined` | Height |
247+
| **logoHeight** | N | Number | `undefined` | Width |
248+
| **logoBackgroundTransparent** | N | Boolean | `false` | Whether the background transparent image(`PNG`) shows transparency. When `true`, `logoBackgroundColor` is invalid |
249+
| **logoBackgroundColor** | N | String | `#ffffff` | Set Background CSS Color when image background transparent. Valid when `logoBackgroundTransparent` is `false` |
250+
| Backgroud Image options| ---|--- |---|---|
251+
| **backgroundImage** | N | String | `undefined` | Background Image Path or Base64 encoded image. If use relative address, relative to `easy.qrcode.min.js` |
252+
| **backgroundImageAlpha** | N | Number | `1.0` | Background image transparency. Ranges: `0-1.0` |
253+
| **autoColor** | N | Boolean | `false` | Automatic color adjustment |
254+
| Posotion Pattern Color options| --- | ---|---|---|
255+
| **PO** | N | String | `undefined` | Global Posotion Outer CSS color. if not set, the defaut is `colorDark` |
256+
| **PI** | N | String | `undefined` | Global Posotion Inner CSS color. if not set, the defaut is `colorDark` |
257+
| **PO_TL** | N | String | `undefined` | Posotion Outer CSS color - Top Left |
258+
| **PI_TL** | N | String | `undefined` | Posotion Inner CSS color - Top Left |
259+
| **PO_TR** | N | String | `undefined` | Posotion Outer CSS color - Top Right |
260+
| **PI_TR** | N | String | `undefined` | Posotion Inner CSS color - Top Right |
261+
| **PO_BL** | N | String | `undefined` | Posotion Outer CSS color - Bottom Left |
262+
| **PI_BL** | N | String | `undefined` | Posotion Inner CSS color - Bottom Left |
263+
| Alignment Color options| --- |--- |---|---|
264+
| **AO** | N | String | `undefined` | Alignment Outer CSS color. if not set, the defaut is `colorDark` |
265+
| **AI** | N | String | `undefined` | Alignment Inner CSS color. if not set, the defaut is `colorDark` |
266+
| Timing Pattern Color options| --- | ---|---|---|
267+
| **timing** | N | String | `undefined` | Global Timing CSS color. if not set, the defaut is `colorDark` |
268+
| **timing_H** | N | String | `undefined` | Horizontal timing CSS color |
269+
| **timing_V** | N | String | `undefined` | Vertical timing CSS color |
270+
| Title options| --- | ---|---|---|
271+
| **title** | N | String | `''` | |
272+
| **titleFont** | N | String | `bold 16px Arial` | CSS Font |
273+
| **titleColor** | N | String | `#000000` | CSS color |
274+
| **titleBackgroundColor** | N | String | `#ffffff` | CSS color|
275+
| **titleHeight** | N | Number | `0` | Title Height, Include subTitle |
276+
| **titleTop** | N | Number | `30` | draws y coordinates.|
277+
| SubTitle options| --- | ---|---|---|
278+
| **subTitle** | N | String | `''` | |
279+
| **subTitleFont** | N | String | `14px Arial` | CSS Font |
280+
| **subTitleColor** | N | String | `#4F4F4F` | CSS color |
281+
| **subTitleTop** | N | Number | `0` | draws y coordinates. default is 0|
282+
| Event Handler options| --- | ---|---|---|
283+
| **onRenderingStart(qrCodeOptions)** | N | Function | `undefined` | Callback function when rendering start work. can use to hide loading state or handling. |
284+
| Images format options| --- | ---|---|---|
285+
| **format** | N | String | `PNG` | 'PNG' or 'JPG' |
286+
| **compressionLevel** | N | Number | `6` | ZLIB compression level between 0 and 9. (**PNGs only**) |
287+
| **quality** | N | Number | `0.75` | An object specifying the quality (0 to 1). (**JPGs only**) |
288+
| Version options| --- | ---|---|---|
289+
| **version** | N | Number | `0` | The symbol versions of QR Code range from Version `1` to Version `40`. default 0 means automatically choose the closest version based on the text length. [Information capacity and versions of QR Codes](https://www.qrcode.com/en/about/version.html) **NOTE**: If you set a value less than the minimum version available for text, the minimum version is automatically used. |
288290

289291

290292
### Methods

0 commit comments

Comments
 (0)