@breakside/jskit 2021.52.0 → 2022.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSColorSpace.js +106 -20
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSColorSpace.js +106 -20
- package/Root/Frameworks/ImageKit/IKColorProfile.js +979 -0
- package/Root/Frameworks/ImageKit/IKColorSpace.js +49 -198
- package/Root/Frameworks/ImageKit/IKMatrix.js +124 -0
- package/Root/Frameworks/ImageKit/ImageKit.js +2 -0
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UICollectionReusableView.js +91 -0
- package/Root/Frameworks/UIKit/UICollectionView.js +1254 -0
- package/Root/Frameworks/UIKit/UICollectionViewCell.js +121 -0
- package/Root/Frameworks/UIKit/UICollectionViewGridLayout.js +425 -0
- package/Root/Frameworks/UIKit/UICollectionViewLayout.js +82 -0
- package/Root/Frameworks/UIKit/UIColorWell.js +12 -1
- package/Root/Frameworks/UIKit/UIDisplayServer.js +5 -1
- package/Root/Frameworks/UIKit/UIKit.js +7 -0
- package/Root/Frameworks/UIKit/UILayer.js +3 -0
- package/Root/Frameworks/UIKit/UIListView.js +8 -9
- package/Root/Frameworks/UIKit/UIMenu.js +1 -1
- package/Root/Frameworks/UIKit/UIMenuView.js +5 -1
- package/Root/Frameworks/UIKit/UINavigationBar.js +2 -2
- package/Root/Frameworks/UIKit/UIPopupButton.js +31 -3
- package/Root/Frameworks/UIKit/UIScrollView.js +2 -0
- package/Root/Frameworks/UIKit/UISplitViewController.js +43 -9
- package/Root/Frameworks/UIKit/UITextField.js +3 -0
- package/Root/Frameworks/UIKit/UIView.js +3 -0
- package/Root/Frameworks/UIKit/UIViewController.js +8 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -88,14 +88,14 @@ JSClass("JSXYZColorSpace", JSColorSpace, {
|
|
|
88
88
|
|
|
89
89
|
name: "xyz",
|
|
90
90
|
|
|
91
|
-
initWithWhitepoint: function(mediaWhitepoint
|
|
92
|
-
if (mediaWhitepoint ===
|
|
91
|
+
initWithWhitepoint: function(mediaWhitepoint){
|
|
92
|
+
if (mediaWhitepoint === JSColorSpace.Whitepoint.profileConnection){
|
|
93
93
|
return JSColorSpace.xyz;
|
|
94
94
|
}
|
|
95
|
-
if (mediaWhitepoint[0] ===
|
|
95
|
+
if (mediaWhitepoint[0] === JSColorSpace.Whitepoint.profileConnection[0] && mediaWhitepoint[1] === JSColorSpace.Whitepoint.profileConnection[1] && mediaWhitepoint[2] === JSColorSpace.Whitepoint.profileConnection[2]){
|
|
96
96
|
return JSColorSpace.xyz;
|
|
97
97
|
}
|
|
98
|
-
return JSXYZScaledColorSpace.initWithWhitepoint(mediaWhitepoint
|
|
98
|
+
return JSXYZScaledColorSpace.initWithWhitepoint(mediaWhitepoint);
|
|
99
99
|
},
|
|
100
100
|
|
|
101
101
|
initWithScale: function(scale){
|
|
@@ -125,11 +125,11 @@ JSClass("JSXYZScaledColorSpace", JSXYZColorSpace, {
|
|
|
125
125
|
_scale: null,
|
|
126
126
|
_inverseScale: null,
|
|
127
127
|
|
|
128
|
-
initWithWhitepoint: function(mediaWhitepoint
|
|
128
|
+
initWithWhitepoint: function(mediaWhitepoint){
|
|
129
129
|
this.initWithScale([
|
|
130
|
-
mediaWhitepoint[0] /
|
|
131
|
-
mediaWhitepoint[1] /
|
|
132
|
-
mediaWhitepoint[2] /
|
|
130
|
+
mediaWhitepoint[0] / JSColorSpace.Whitepoint.profileConnection[0],
|
|
131
|
+
mediaWhitepoint[1] / JSColorSpace.Whitepoint.profileConnection[1],
|
|
132
|
+
mediaWhitepoint[2] / JSColorSpace.Whitepoint.profileConnection[2]
|
|
133
133
|
]);
|
|
134
134
|
},
|
|
135
135
|
|
|
@@ -164,10 +164,7 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
164
164
|
|
|
165
165
|
name: "lab",
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
initWithWhitepoint: function(mediaWhitepoint){
|
|
170
|
-
this.mediaWhitepoint = mediaWhitepoint;
|
|
167
|
+
init: function(){
|
|
171
168
|
},
|
|
172
169
|
|
|
173
170
|
xyzFromComponents: function(components){
|
|
@@ -181,9 +178,9 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
181
178
|
var fx = components[1] / 500.0 + fy;
|
|
182
179
|
var fz = fy - components[2] / 200.0;
|
|
183
180
|
return [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
JSColorSpace.Whitepoint.profileConnection[0] * fi(fx),
|
|
182
|
+
JSColorSpace.Whitepoint.profileConnection[1] * fi(fy),
|
|
183
|
+
JSColorSpace.Whitepoint.profileConnection[2] * fi(fz)
|
|
187
184
|
];
|
|
188
185
|
},
|
|
189
186
|
|
|
@@ -194,9 +191,9 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
194
191
|
}
|
|
195
192
|
return (841.0 / 108.0) * x + 4.0 / 29.0;
|
|
196
193
|
};
|
|
197
|
-
var fx = f(xyz[0] /
|
|
198
|
-
var fy = f(xyz[1] /
|
|
199
|
-
var fz = f(xyz[2] /
|
|
194
|
+
var fx = f(xyz[0] / JSColorSpace.Whitepoint.profileConnection[0]);
|
|
195
|
+
var fy = f(xyz[1] / JSColorSpace.Whitepoint.profileConnection[1]);
|
|
196
|
+
var fz = f(xyz[2] / JSColorSpace.Whitepoint.profileConnection[2]);
|
|
200
197
|
return [
|
|
201
198
|
116.0 * fy - 16.0,
|
|
202
199
|
500.0 * (fx - fy),
|
|
@@ -239,10 +236,52 @@ JSClass("JSRGBColorSpace", JSColorSpace, {
|
|
|
239
236
|
|
|
240
237
|
// MARK: - Lab conversions
|
|
241
238
|
|
|
239
|
+
xyzMatrix: [
|
|
240
|
+
[0.4360, 0.3851, 0.1431],
|
|
241
|
+
[0.2225, 0.7169, 0.0606],
|
|
242
|
+
[0.0139, 0.09710, 0.7139]
|
|
243
|
+
],
|
|
244
|
+
|
|
245
|
+
xyzInverseMatrix: [
|
|
246
|
+
[3.13458, -1.61731, -0.491034],
|
|
247
|
+
[-0.978957, 1.91622, 0.0335704],
|
|
248
|
+
[0.0721194, -0.229142, 1.40575]
|
|
249
|
+
],
|
|
250
|
+
|
|
251
|
+
g: 2.4,
|
|
252
|
+
a: 1.0 / 1.055,
|
|
253
|
+
b: 0.055 / 1.055,
|
|
254
|
+
c: 1.0 / 12.92,
|
|
255
|
+
d: 0.04045,
|
|
256
|
+
|
|
257
|
+
curve: function(x){
|
|
258
|
+
return parametricCurve3(x, this.g, this.a, this.b, this.c, this.d);
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
inverseCurve: function(y){
|
|
262
|
+
y = Math.max(0, Math.min(1, y));
|
|
263
|
+
return inverseParametricCurve3(y, this.g, this.a, this.b, this.c, this.d);
|
|
264
|
+
},
|
|
265
|
+
|
|
242
266
|
xyzFromComponents: function(components){
|
|
267
|
+
var rgb = [
|
|
268
|
+
this.curve(components[0]),
|
|
269
|
+
this.curve(components[1]),
|
|
270
|
+
this.curve(components[2])
|
|
271
|
+
];
|
|
272
|
+
return [
|
|
273
|
+
this.xyzMatrix[0][0] * rgb[0] + this.xyzMatrix[0][1] * rgb[1] + this.xyzMatrix[0][2] * rgb[2],
|
|
274
|
+
this.xyzMatrix[1][0] * rgb[0] + this.xyzMatrix[1][1] * rgb[1] + this.xyzMatrix[1][2] * rgb[2],
|
|
275
|
+
this.xyzMatrix[2][0] * rgb[0] + this.xyzMatrix[2][1] * rgb[1] + this.xyzMatrix[2][2] * rgb[2]
|
|
276
|
+
];
|
|
243
277
|
},
|
|
244
278
|
|
|
245
279
|
componentsFromXYZ: function(xyz){
|
|
280
|
+
return [
|
|
281
|
+
this.inverseCurve(this.xyzInverseMatrix[0][0] * xyz[0] + this.xyzInverseMatrix[0][1] * xyz[1] + this.xyzInverseMatrix[0][2] * xyz[2]),
|
|
282
|
+
this.inverseCurve(this.xyzInverseMatrix[1][0] * xyz[0] + this.xyzInverseMatrix[1][1] * xyz[1] + this.xyzInverseMatrix[1][2] * xyz[2]),
|
|
283
|
+
this.inverseCurve(this.xyzInverseMatrix[2][0] * xyz[0] + this.xyzInverseMatrix[2][1] * xyz[1] + this.xyzInverseMatrix[2][2] * xyz[2])
|
|
284
|
+
];
|
|
246
285
|
},
|
|
247
286
|
|
|
248
287
|
// MARK: - rgb <-> hsl
|
|
@@ -425,7 +464,38 @@ JSClass("JSGrayColorSpace", JSColorSpace, {
|
|
|
425
464
|
return [
|
|
426
465
|
components[0] + (1.0 - components[0]) * percentage
|
|
427
466
|
];
|
|
428
|
-
}
|
|
467
|
+
},
|
|
468
|
+
|
|
469
|
+
g: 2.4,
|
|
470
|
+
a: 1.0 / 1.055,
|
|
471
|
+
b: 0.055 / 1.055,
|
|
472
|
+
c: 1.0 / 12.92,
|
|
473
|
+
d: 0.04045,
|
|
474
|
+
|
|
475
|
+
curve: function(x){
|
|
476
|
+
return parametricCurve3(x, this.g, this.a, this.b, this.c, this.d);
|
|
477
|
+
},
|
|
478
|
+
|
|
479
|
+
inverseCurve: function(y){
|
|
480
|
+
y = Math.max(0, Math.min(1, y));
|
|
481
|
+
return inverseParametricCurve3(y, this.g, this.a, this.b, this.c, this.d);
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
// MARK: - Lab conversions
|
|
485
|
+
|
|
486
|
+
xyzFromComponents: function(components){
|
|
487
|
+
var w = this.curve(components[0]);
|
|
488
|
+
return [
|
|
489
|
+
JSColorSpace.Whitepoint.profileConnection[0] * w,
|
|
490
|
+
JSColorSpace.Whitepoint.profileConnection[1] * w,
|
|
491
|
+
JSColorSpace.Whitepoint.profileConnection[2] * w
|
|
492
|
+
];
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
componentsFromXYZ: function(xyz){
|
|
496
|
+
var y = Math.min(JSColorSpace.Whitepoint.profileConnection[1], Math.max(0, xyz[1])) / JSColorSpace.Whitepoint.profileConnection[1];
|
|
497
|
+
return [this.inverseCurve(y)];
|
|
498
|
+
},
|
|
429
499
|
|
|
430
500
|
});
|
|
431
501
|
|
|
@@ -622,7 +692,7 @@ Object.defineProperties(JSColorSpace, {
|
|
|
622
692
|
lab: {
|
|
623
693
|
configurable: true,
|
|
624
694
|
get: function(){
|
|
625
|
-
var space = JSLabColorSpace.
|
|
695
|
+
var space = JSLabColorSpace.init();
|
|
626
696
|
Object.defineProperty(this, "lab", {value: space});
|
|
627
697
|
return space;
|
|
628
698
|
}
|
|
@@ -635,4 +705,20 @@ JSColorSpace.Whitepoint = {
|
|
|
635
705
|
D65: [0.9505, 1.0, 1.08883]
|
|
636
706
|
};
|
|
637
707
|
|
|
708
|
+
JSColorSpace.Whitepoint.profileConnection = JSColorSpace.Whitepoint.D50;
|
|
709
|
+
|
|
710
|
+
var parametricCurve3 = function(x, g, a, b, c, d){
|
|
711
|
+
if (x >= d){
|
|
712
|
+
return Math.pow(a * x + b, g);
|
|
713
|
+
}
|
|
714
|
+
return c * x;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
var inverseParametricCurve3 = function(y, g, a, b, c, d){
|
|
718
|
+
if (y < c * d){
|
|
719
|
+
return y / c;
|
|
720
|
+
}
|
|
721
|
+
return (Math.pow(y, 1.0 / g) - b) / a;
|
|
722
|
+
};
|
|
723
|
+
|
|
638
724
|
})();
|