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