You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
159
145
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`
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.
| **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 |
| **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. |
|**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. |
0 commit comments