@@ -193,6 +193,129 @@ void main() {
193
193
runCheck (0xFFFFFFE0 , const Color (0x4dadad90 )); // 0x4dacad90
194
194
runCheck (0xFFFF69B4 , const Color (0x4dff69b4 ));
195
195
});
196
+
197
+ test ('iconOnPlainBackground' , () {
198
+ void runCheck (int base , Color expected) {
199
+ check (StreamColorSwatch (base )).iconOnPlainBackground.equals (expected);
200
+ }
201
+
202
+ // Check against everything in ZULIP_ASSIGNMENT_COLORS
203
+ // in <https://replit.com/@VladKorobov/zulip-topic-feed-colors#script.js>.
204
+ // (Skipping `streamColors` because there are 100+ of them.)
205
+ // On how to extract expected results from the replit, see:
206
+ // TODO
207
+
208
+ // TODO Fix bug causing our implementation's results to differ from the
209
+ // replit's. Where they differ, see comment with what the replit gives.
210
+
211
+ runCheck (0xff76ce90 , const Color (0xff73cb8d ));
212
+ runCheck (0xfffae589 , const Color (0xffccb95f )); // 0xffcbb85e
213
+ runCheck (0xffa6c7e5 , const Color (0xff9cbcda )); // 0xff9cbddb
214
+ runCheck (0xffe79ab5 , const Color (0xffe79ab5 ));
215
+ runCheck (0xffbfd56f , const Color (0xffacc25d ));
216
+ runCheck (0xfff4ae55 , const Color (0xfff0ab52 )); // 0xffefa951
217
+ runCheck (0xffb0a5fd , const Color (0xffb0a5fd ));
218
+ runCheck (0xffaddfe5 , const Color (0xff90c1c7 )); // 0xff90c2c8
219
+ runCheck (0xfff5ce6e , const Color (0xffd9b456 )); // 0xffd8b355
220
+ runCheck (0xffc2726a , const Color (0xffc2726a ));
221
+ runCheck (0xff94c849 , const Color (0xff94c849 ));
222
+ runCheck (0xffbd86e5 , const Color (0xffbd86e5 ));
223
+ runCheck (0xffee7e4a , const Color (0xffee7e4a ));
224
+ runCheck (0xffa6dcbf , const Color (0xff8fc4a8 ));
225
+ runCheck (0xff95a5fd , const Color (0xff95a5fd ));
226
+ runCheck (0xff53a063 , const Color (0xff53a063 ));
227
+ runCheck (0xff9987e1 , const Color (0xff9987e1 ));
228
+ runCheck (0xffe4523d , const Color (0xffe4523d ));
229
+ runCheck (0xffc2c2c2 , const Color (0xffb9b9b9 ));
230
+ runCheck (0xff4f8de4 , const Color (0xff4f8de4 ));
231
+ runCheck (0xffc6a8ad , const Color (0xffc6a8ad ));
232
+ runCheck (0xffe7cc4d , const Color (0xffd1b839 )); // 0xffd0b737
233
+ runCheck (0xffc8bebf , const Color (0xffc0b6b7 ));
234
+ runCheck (0xffa47462 , const Color (0xffa47462 ));
235
+ runCheck (0xffacc25d , const Color (0xffacc25d ));
236
+ });
237
+
238
+ test ('iconOnBarBackground' , () {
239
+ void runCheck (int base , Color expected) {
240
+ check (StreamColorSwatch (base )).iconOnBarBackground.equals (expected);
241
+ }
242
+
243
+ // Check against everything in ZULIP_ASSIGNMENT_COLORS
244
+ // in <https://replit.com/@VladKorobov/zulip-topic-feed-colors#script.js>.
245
+ // (Skipping `streamColors` because there are 100+ of them.)
246
+ // On how to extract expected results from the replit, see:
247
+ // TODO
248
+
249
+ // TODO Fix bug causing our implementation's results to differ from the
250
+ // replit's. Where they differ, see comment with what the replit gives.
251
+
252
+ runCheck (0xff76ce90 , const Color (0xff46ba69 ));
253
+ runCheck (0xfffae589 , const Color (0xffb49f39 )); // 0xffb29d3a
254
+ runCheck (0xffa6c7e5 , const Color (0xff6f9ec9 )); // 0xff6f9fcb
255
+ runCheck (0xffe79ab5 , const Color (0xffdb6991 ));
256
+ runCheck (0xffbfd56f , const Color (0xff8ea43e ));
257
+ runCheck (0xfff4ae55 , const Color (0xffeb901a )); // 0xffea8d19
258
+ runCheck (0xffb0a5fd , const Color (0xff7b69fc ));
259
+ runCheck (0xffaddfe5 , const Color (0xff67aab2 )); // 0xff67acb4
260
+ runCheck (0xfff5ce6e , const Color (0xffc59a2c )); // 0xffc3992d
261
+ runCheck (0xffc2726a , const Color (0xffa94e45 ));
262
+ runCheck (0xff94c849 , const Color (0xff74a331 ));
263
+ runCheck (0xffbd86e5 , const Color (0xffa254da ));
264
+ runCheck (0xffee7e4a , const Color (0xffe55716 ));
265
+ runCheck (0xffa6dcbf , const Color (0xff67af89 ));
266
+ runCheck (0xff95a5fd , const Color (0xff5972fc ));
267
+ runCheck (0xff53a063 , const Color (0xff3e784a ));
268
+ runCheck (0xff9987e1 , const Color (0xff6f56d5 ));
269
+ runCheck (0xffe4523d , const Color (0xffc8311c ));
270
+ runCheck (0xffc2c2c2 , const Color (0xff9a9a9a ));
271
+ runCheck (0xff4f8de4 , const Color (0xff216cd5 ));
272
+ runCheck (0xffc6a8ad , const Color (0xffae838a ));
273
+ runCheck (0xffe7cc4d , const Color (0xffa69127 )); // 0xffa38f26
274
+ runCheck (0xffc8bebf , const Color (0xffa49597 ));
275
+ runCheck (0xffa47462 , const Color (0xff7f584a ));
276
+ runCheck (0xffacc25d , const Color (0xff8ea43e ));
277
+ });
278
+
279
+ test ('barBackground' , () {
280
+ void runCheck (int base , Color expected) {
281
+ check (StreamColorSwatch (base )).barBackground.equals (expected);
282
+ }
283
+
284
+ // Check against everything in ZULIP_ASSIGNMENT_COLORS
285
+ // in <https://replit.com/@VladKorobov/zulip-topic-feed-colors#script.js>.
286
+ // (Skipping `streamColors` because there are 100+ of them.)
287
+ // On how to extract expected results from the replit, see:
288
+ // TODO
289
+
290
+ // TODO Fix bug causing our implementation's results to differ from the
291
+ // replit's. Where they differ, see comment with what the replit gives.
292
+
293
+ runCheck (0xff76ce90 , const Color (0xffddefe1 ));
294
+ runCheck (0xfffae589 , const Color (0xfff1ead7 )); // 0xfff0ead6
295
+ runCheck (0xffa6c7e5 , const Color (0xffe5ebf2 )); // 0xffe5ecf2
296
+ runCheck (0xffe79ab5 , const Color (0xfff6e4ea ));
297
+ runCheck (0xffbfd56f , const Color (0xffe9edd6 ));
298
+ runCheck (0xfff4ae55 , const Color (0xfffbe7d4 )); // 0xfffae7d4
299
+ runCheck (0xffb0a5fd , const Color (0xffeae6fa ));
300
+ runCheck (0xffaddfe5 , const Color (0xffe2edee ));
301
+ runCheck (0xfff5ce6e , const Color (0xfff5e9d5 )); // 0xfff4e9d5
302
+ runCheck (0xffc2726a , const Color (0xfff0dbd8 )); // 0xffefdbd8
303
+ runCheck (0xff94c849 , const Color (0xffe5eed3 )); // 0xffe4eed3
304
+ runCheck (0xffbd86e5 , const Color (0xffeddff5 ));
305
+ runCheck (0xffee7e4a , const Color (0xfffdded1 )); // 0xfffcded1
306
+ runCheck (0xffa6dcbf , const Color (0xffe2ede7 ));
307
+ runCheck (0xff95a5fd , const Color (0xffe5e6fa )); // 0xffe4e6fa
308
+ runCheck (0xff53a063 , const Color (0xffd5e5d6 ));
309
+ runCheck (0xff9987e1 , const Color (0xffe5dff4 ));
310
+ runCheck (0xffe4523d , const Color (0xfffcd6cd )); // 0xfffbd6cd
311
+ runCheck (0xffc2c2c2 , const Color (0xffebebeb ));
312
+ runCheck (0xff4f8de4 , const Color (0xffd9e0f5 )); // 0xffd8e0f5
313
+ runCheck (0xffc6a8ad , const Color (0xffeee7e8 ));
314
+ runCheck (0xffe7cc4d , const Color (0xfff4ead0 )); // 0xfff3eacf
315
+ runCheck (0xffc8bebf , const Color (0xffeceaea ));
316
+ runCheck (0xffa47462 , const Color (0xffe7dad6 ));
317
+ runCheck (0xffacc25d , const Color (0xffe9edd6 ));
318
+ });
196
319
});
197
320
});
198
321
0 commit comments