/
config-example.json
662 lines (589 loc) · 14.7 KB
/
config-example.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
{
// $Date: 2009-11-08 19:54:46 +0200 $
// TODO: try jsdoc-toolkit on this json (!)
/**
* The list of available languages. This associated language IDs to their
* language titles.
*
* @type Object
*/
"languages": {
// Besides the language title, you may also tell the file name. The 'file'
// property needs to be relative to the PaintWeb baseFolder. If no 'file' is
// given, then the 'en.json' file name is used, and the file will be loaded
// from the 'langFolder' you specify below.
"en": { "title": "English" }
},
/**
* The default language.
*
* @type String
* @default "en"
*/
"lang": "en",
/**
* The folder which holds the language files.
*
* @type String
* @default "lang"
*/
"langFolder": "lang",
/**
* The graphical user interface you want to use.
*
* @type String
* @default "default"
*/
"gui": "default",
/**
* The folder contains all the interfaces.
*
* @type String
* @default "interfaces"
*/
"interfacesFolder": "interfaces",
/**
* The interface markup file. The file must be an XHTML valid document.
*
* @type String
* @default "layout.xhtml"
*/
"guiMarkup": "layout.xhtml",
/**
* The interface style file.
*
* @type String
* @default "style.css"
*/
"guiStyle": "style.css",
/**
* The interface script file.
*
* @type String
* @default script.js
*/
"guiScript": "script.js",
/**
* The image viewport width. Make sure the value is a CSS length, like "50%",
* "450px" or "30em".
*
* <p>Note: the GUI implementation might ignore this value.
*
* @type String
* @default "100%"
*/
"viewportWidth": "100%",
/**
* The image viewport height. Make sure the value is a CSS length, like "50%",
* "450px" or "30em".
*
* <p>Note: the GUI implementation might ignore this value.
*
* @type String
* @default "400px"
*/
"viewportHeight": "400px",
/**
* Image save quality for the JPEG format.
*
* @type Number
* @default 0.9
*/
"jpegSaveQuality": 0.9,
/**
* The default image width.
*
* @type Number
* @default 400
*/
"imageWidth": 400,
/**
* The default image width.
*
* @type Number
* @default 300
*/
"imageHeight": 300,
/**
* Image preload. The image you want to display when PaintWeb loads. This must
* be a reference to an HTML Image element.
*
* @type HTMLImageElement
* @default null
*/
"imagePreload": null,
/**
* Default background color.
*
* @type CSS3Color
* @default "#fff"
*/
"backgroundColor": "#fff",
/**
* Default fill style.
*
* @type CSS3Color-rgba functional notation
* @default "rgba(0,0,0,1)"
*/
"fillStyle": "rgba(0,0,0,1)",
/**
* Default stroke style.
*
* @type CSS3Color-rgba functional notation
* @default "rgba(0,0,255,1)"
*/
"strokeStyle": "rgba(0,0,255,1)",
/**
* Enable checkers background. This tells the user interface to render
* checkers in the image background. These are visible only when parts of
* the image being edited are transparent.
*
* <p>If the device you are running PaintWeb on has limited resources,
* disabling the checkers background should improve the drawing performance.
*
* @type Boolean
* @default true
*/
"checkersBackground": true,
/**
* GUI placeholder element. This element will hold all the PaintWeb interface
* elements.
*
* <p>For a successful initialization of PaintWeb, you must define this
* configuration value programatically from your scripts.
*
* @type Element
* @default null
*/
"guiPlaceholder": null,
/**
* Shape drawing "type": filled, only stroke, or both. Possible values:
* "filled", "stroke" or "both".
*
* @type String
* @default "both"
*/
"shapeType": "both",
/**
* Number of available history steps.
*
* @type Number
* @default 10
*/
"historyLimit": 10,
/**
* Zoom factor when the user increases/decreases the image zoom level.
*
* @type Number
* @default 0.05
*/
// 0.05 means 5% zoom.
"imageZoomStep": 0.05,
/**
* The maximum allowed image zoom level.
*
* @type Number
* @default 4
*/
// 4 means 400% zoom.
"imageZoomMax": 4,
/**
* The minimum allowed image zoom level.
*
* @type Number
* @default 0.2
*/
// 0.2 means 20% zoom.
"imageZoomMin": 0.2,
/**
* The image zoom control keys, for zoom in, zoom out and zoom reset.
* @type Object
*/
"imageZoomKeys": {
"in": "+",
"out": "-",
"reset": "*"
},
/**
* Holds the list of drawing tools you want to load.
* @type Array
*/
"tools": ["bcurve", "cbucket", "cpicker", "ellipse", "eraser", "hand", "insertimg", "line", "pencil", "polygon", "rectangle", "selection", "text"],
/**
* Tools folder.
* @type String
* @default "tools"
*/
"toolsFolder": "tools",
/**
* The default tool ID.
*
* @type String
* @default "line"
* @see this.tools The array holding the list of drawing tools you want
* loaded.
*/
"toolDefault": "line",
/**
* Tool drawing delay (milliseconds). Some tools delay their drawing
* operations for performance reasons.
*
* @type Number
* @default 80
*/
"toolDrawDelay": 80,
/**
* Holds the list of extensions you want to load.
* @type Array
*/
"extensions": ["colormixer", "mousekeys"],
/**
* Extensions folder.
*
* @type String
* @default "extensions"
*/
"extensionsFolder": "extensions",
/**
* @namespace Line tool options.
*/
"line": {
/**
* Line cap. Possible values: "butt", "round", "square".
*
* @type String
* @default "round"
*/
"lineCap": "round",
/**
* Line join. Possible values: "round", "bevel", "miter".
*
* @type String
* @default "round"
*/
"lineJoin": "round",
/**
* Line width.
*
* @type Number
* @default 1
*/
"lineWidth": 1,
/**
* Miter limit.
*
* @type Number
* @default 10
*/
"miterLimit": 10
},
/**
* @namespace Shadow options.
*/
"shadow": {
/**
* Tells if a shadow should render or not.
*
* @type Boolean
* @default false
*/
"enable": false,
/**
* Shadow color
*
* @type CSS3Color-rgba() functional notation
* @default "rgba(0,0,0,1)"
*/
"shadowColor": "rgba(0,0,0,1)",
/**
* Shadow blur.
*
* @type Number
* @default 5
*/
"shadowBlur": 5,
/**
* Shadow offset X.
*
* @type Number
* @default 5
*/
"shadowOffsetX": 5,
/**
* Shadow offset %.
*
* @type Number
* @default 5
*/
"shadowOffsetY": 5
},
/**
* @namespace Selection tool options.
*/
"selection": {
/**
* Selection transformation mode. This tells if any drag/resize would also
* affect the selected pixels or not.
*
* @type Boolean
* @default false
*/
"transform": false,
/**
* Transparent selection.
*
* @type Boolean
* @default true
*/
"transparent": true,
/**
* Selection marquee border width.
*
* @type Number
* @default 3
*/
"borderWidth": 3,
/**
* Keyboard shortcuts for several selection-related commands.
* @type Object
*/
"keys": {
"selectionCrop": "Control K",
"selectionDelete": "Delete",
"selectionDrop": "Escape",
"selectionFill": "Alt Backspace",
"transformToggle": "Enter"
}
},
/**
* Text tool options.
* @type Object
*/
"text": {
"bold": false,
"italic": false,
/**
* The default list of font families available in font family drop-down.
* @type Array
*/
"fontFamilies": ["sans-serif", "serif", "cursive", "fantasy", "monospace"],
/**
* The font family used for rendering the text.
* @type String
* @default "sans-serif"
*/
"fontFamily": "sans-serif",
"fontSize": 36,
/**
* Horizontal text alignment. Possible values: "left", "center", "right".
*
* <p>Note that the Canvas Text API also defines the "start" and "end"
* values, which are not "supported" by PaintWeb.
*
* @type String
* @default "left"
*/
"textAlign": "left",
/**
* Vertical text alignment. Possible values: "top", "hanging", "middle",
* "alphabetic", "ideographic", or "bottom".
*
* @type String
* @default "alphabetic"
*/
"textBaseline": "top"
},
/**
* @namespace Color Mixer extension configuration.
*/
"colormixer": {
/**
* Holds the minimum and maximum value for each color channel input field.
* The value incrementation step is also included - this is used the user
* presses the up/down arrow keys in the input of the color channel.
*
* @type Object
*/
"inputValues": {
// RGB
// order: minimum, maximum, step
"red": [0, 255, 1],
"green": [0, 255, 1],
"blue": [0, 255, 1],
// HSV
// Hue - degrees
"hue": [0, 360, 1],
"sat": [0, 255, 1],
"val": [0, 255, 1],
// CMYK - all are percentages
"cyan": [0, 100, 1],
"magenta": [0, 100, 1],
"yellow": [0, 100, 1],
"black": [0, 100, 1],
// CIE Lab
// cie_l = Lightness, it's a percentage value
// cie_a and cie_b are the color-opponent dimensions
"cie_l": [ 0, 100, 1],
"cie_a": [ -86, 98, 1],
"cie_b": [-107, 94, 1],
"alpha": [0, 100, 1]
},
/**
* CIE Lab configuration.
* @type Object
*/
"lab": {
// The RGB working space is sRGB which has the reference white point of
// D65.
// These are the chromaticity coordinates for the red, green and blue
// primaries.
"x_r": 0.64,
"y_r": 0.33,
"x_g": 0.3,
"y_g": 0.6,
"x_b": 0.13,
"y_b": 0.06,
// Standard observer: D65 (daylight), 2° (CIE 1931).
// Chromaticity coordinates.
"ref_x": 0.31271,
"ref_y": 0.32902,
// This is the calculated reference white point (xyY to XYZ) for D65, also
// known as the reference illuminant tristimulus.
// These values are updated based on chromaticity coordinates, during
// initialization.
"w_x": 0.95047,
"w_y": 1,
"w_z": 1.08883,
// The 3x3 matrix used for multiplying the RGB values when converting RGB
// to XYZ.
// These values are updated based on the chromaticity coordinates, during
// initialization.
"m": [ 0.412424, 0.212656, 0.0193324,
0.357579, 0.715158, 0.119193,
0.180464, 0.0721856, 0.950444],
// The same matrix, but inverted. This is used for the XYZ to RGB conversion.
"m_i": [ 3.24071, -0.969258, 0.0556352,
-1.53726, 1.87599, -0.203996,
-0.498571, 0.0415557, 1.05707]
},
/**
* Slider width. This value must be relative to the color space
* visualisation canvas element: 1 means full width, 0.5 means half width,
* etc.
*
* @type Number
* @default 0.10 (which is 10% of the canvas element width)
*/
"sliderWidth": 0.10,
/**
* Spacing between the slider and the color chart.
*
* @type Number
* @default 0.03 (which is 3% of the canvas element width)
*/
"sliderSpacing": 0.03,
/**
* Holds the list of color palettes.
* @type Object
*/
"colorPalettes": {
"_saved" : {
// Color values are: red, green, blue. All three channels have values
// ranging between 0 and 1.
"colors" : [[1,1,1], [1,1,0], [1,0,1], [0,1,1], [1,0,0], [0,1,0], [0,0,1], [0,0,0]]
},
"windows" : {
"file" : "colors/windows.json"
},
"macos" : {
"file" : "colors/macos.json"
},
"web" : {
"file" : "colors/web.json"
}
},
"paletteDefault": "windows"
},
/**
* @namespace Holds the MouseKeys extension options.
*/
"mousekeys": {
/**
* The mouse keys movement acceleration.
*
* @type Number
* @default 0.1
* @see PaintMouseKeys The MouseKeys extension.
*/
"accel": 0.1,
/**
* Holds the list of actions, associated to keyboard shortcuts.
*
* @type Object
*/
// We make sure the number keys on the NumPad also work when the Shift key
// is down.
"actions": {
"ButtonToggle": [0],
"SouthWest": [1],
"South": [2],
"SouthEast": [3],
"West": [4],
"ButtonClick": [5],
"East": [6],
"NorthWest": [7],
"North": [8],
"NorthEast": [9]
/*
You might want Shift+NumPad keys as well ...
Shift+Arrows breaks spatial navigation in Opera.
"ButtonToggle": [0, "Shift Insert"],
"SouthWest": [1, "Shift End"],
"South": [2, "Shift Down"],
"SouthEast": [3, "Shift PageDown"],
"West": [4, "Shift Left"],
"ButtonClick": [5, "Shift Clear"],
"East": [6, "Shift Right"],
"NorthWest": [7, "Shift Home"],
"North": [8, "Shift Up"],
"NorthEast": [9, "Shift PageUp"]
*/
}
},
/**
* Keyboard shortcuts associated to drawing tools and other actions.
*
* @type Object
* @see PaintTools The object holding all the drawing tools.
*/
"keys": {
// Use "command": "id" to execute some command.
"Control Z": { "command": "historyUndo" },
"Control Y": { "command": "historyRedo" },
"Control N": { "command": "imageClear" },
"Control S": { "command": "imageSave" },
"Control A": { "command": "selectAll" },
"Control X": { "command": "selectionCut" },
"Shift Delete": { "command": "selectionCut" },
"Control C": { "command": "selectionCopy" },
"Control V": { "command": "clipboardPaste" },
// Use "toolActivate": "id" to activate the tool with the given ID.
"C": { "toolActivate": "cpicker" },
"E": { "toolActivate": "ellipse" },
"F": { "toolActivate": "cbucket" },
"G": { "toolActivate": "polygon" },
"H": { "toolActivate": "hand" },
"I": { "toolActivate": "insertimg" },
"L": { "toolActivate": "line" },
"O": { "toolActivate": "eraser" },
"P": { "toolActivate": "pencil" },
"R": { "toolActivate": "rectangle" },
"S": { "toolActivate": "selection" },
"T": { "toolActivate": "text" },
"V": { "toolActivate": "bcurve" },
// Miscellaneous commands.
"X": { "command": "swapFillStroke" },
"F1": { "command": "about" }
}
// vim:set spell spl=en fo=wan1croql tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix ft=javascript:
}