@@ -192,7 +192,7 @@ public class ColorSpec2021 : ColorSpec
192192 . SetIsBackground ( true )
193193 . SetBackground ( HighestSurface )
194194 . SetContrastCurve ( _ => new ContrastCurve ( 3.0 , 4.5 , 7.0 , 7.0 ) )
195- . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryContainer , Primary , 10.0 , TonePolarity . NEARER , false ) )
195+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryContainer , Primary , 10.0 , TonePolarity . Nearer , false ) )
196196 . Build ( ) ;
197197
198198 public DynamicColor ? PrimaryDim => null ;
@@ -217,7 +217,7 @@ public class ColorSpec2021 : ColorSpec
217217 . SetIsBackground ( true )
218218 . SetBackground ( HighestSurface )
219219 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
220- . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryContainer , Primary , 10.0 , TonePolarity . NEARER , false ) )
220+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryContainer , Primary , 10.0 , TonePolarity . Nearer , false ) )
221221 . Build ( ) ;
222222
223223 public DynamicColor OnPrimaryContainer => new DynamicColor . Builder ( )
@@ -249,7 +249,7 @@ public class ColorSpec2021 : ColorSpec
249249 . SetIsBackground ( true )
250250 . SetBackground ( HighestSurface )
251251 . SetContrastCurve ( _ => new ContrastCurve ( 3.0 , 4.5 , 7.0 , 7.0 ) )
252- . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryContainer , Secondary , 10.0 , TonePolarity . NEARER , false ) )
252+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryContainer , Secondary , 10.0 , TonePolarity . Nearer , false ) )
253253 . Build ( ) ;
254254
255255 public DynamicColor ? SecondaryDim => null ;
@@ -275,7 +275,7 @@ public class ColorSpec2021 : ColorSpec
275275 . SetIsBackground ( true )
276276 . SetBackground ( HighestSurface )
277277 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
278- . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryContainer , Secondary , 10.0 , TonePolarity . NEARER , false ) )
278+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryContainer , Secondary , 10.0 , TonePolarity . Nearer , false ) )
279279 . Build ( ) ;
280280
281281 public DynamicColor OnSecondaryContainer => new DynamicColor . Builder ( )
@@ -299,7 +299,7 @@ public class ColorSpec2021 : ColorSpec
299299 . SetIsBackground ( true )
300300 . SetBackground ( HighestSurface )
301301 . SetContrastCurve ( _ => new ContrastCurve ( 3.0 , 4.5 , 7.0 , 7.0 ) )
302- . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryContainer , Tertiary , 10.0 , TonePolarity . NEARER , false ) )
302+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryContainer , Tertiary , 10.0 , TonePolarity . Nearer , false ) )
303303 . Build ( ) ;
304304
305305 public DynamicColor ? TertiaryDim => null ;
@@ -325,7 +325,7 @@ public class ColorSpec2021 : ColorSpec
325325 . SetIsBackground ( true )
326326 . SetBackground ( HighestSurface )
327327 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
328- . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryContainer , Tertiary , 10.0 , TonePolarity . NEARER , false ) )
328+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryContainer , Tertiary , 10.0 , TonePolarity . Nearer , false ) )
329329 . Build ( ) ;
330330
331331 public DynamicColor OnTertiaryContainer => new DynamicColor . Builder ( )
@@ -349,7 +349,7 @@ public class ColorSpec2021 : ColorSpec
349349 . SetIsBackground ( true )
350350 . SetBackground ( HighestSurface )
351351 . SetContrastCurve ( _ => new ContrastCurve ( 3.0 , 4.5 , 7.0 , 7.0 ) )
352- . SetToneDeltaPair ( _ => new ToneDeltaPair ( ErrorContainer , Error , 10.0 , TonePolarity . NEARER , false ) )
352+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( ErrorContainer , Error , 10.0 , TonePolarity . Nearer , false ) )
353353 . Build ( ) ;
354354
355355 public DynamicColor ? ErrorDim => null ;
@@ -369,7 +369,7 @@ public class ColorSpec2021 : ColorSpec
369369 . SetIsBackground ( true )
370370 . SetBackground ( HighestSurface )
371371 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
372- . SetToneDeltaPair ( _ => new ToneDeltaPair ( ErrorContainer , Error , 10.0 , TonePolarity . NEARER , false ) )
372+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( ErrorContainer , Error , 10.0 , TonePolarity . Nearer , false ) )
373373 . Build ( ) ;
374374
375375 public DynamicColor OnErrorContainer => new DynamicColor . Builder ( )
@@ -388,7 +388,7 @@ public class ColorSpec2021 : ColorSpec
388388 . SetIsBackground ( true )
389389 . SetBackground ( HighestSurface )
390390 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
391- . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryFixed , PrimaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
391+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryFixed , PrimaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
392392 . Build ( ) ;
393393
394394 public DynamicColor PrimaryFixedDim => new DynamicColor . Builder ( )
@@ -398,7 +398,7 @@ public class ColorSpec2021 : ColorSpec
398398 . SetIsBackground ( true )
399399 . SetBackground ( HighestSurface )
400400 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
401- . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryFixed , PrimaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
401+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( PrimaryFixed , PrimaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
402402 . Build ( ) ;
403403
404404 public DynamicColor OnPrimaryFixed => new DynamicColor . Builder ( )
@@ -427,7 +427,7 @@ public class ColorSpec2021 : ColorSpec
427427 . SetIsBackground ( true )
428428 . SetBackground ( HighestSurface )
429429 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
430- . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryFixed , SecondaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
430+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryFixed , SecondaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
431431 . Build ( ) ;
432432
433433 public DynamicColor SecondaryFixedDim => new DynamicColor . Builder ( )
@@ -437,7 +437,7 @@ public class ColorSpec2021 : ColorSpec
437437 . SetIsBackground ( true )
438438 . SetBackground ( HighestSurface )
439439 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
440- . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryFixed , SecondaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
440+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( SecondaryFixed , SecondaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
441441 . Build ( ) ;
442442
443443 public DynamicColor OnSecondaryFixed => new DynamicColor . Builder ( )
@@ -466,7 +466,7 @@ public class ColorSpec2021 : ColorSpec
466466 . SetIsBackground ( true )
467467 . SetBackground ( HighestSurface )
468468 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
469- . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryFixed , TertiaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
469+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryFixed , TertiaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
470470 . Build ( ) ;
471471
472472 public DynamicColor TertiaryFixedDim => new DynamicColor . Builder ( )
@@ -476,7 +476,7 @@ public class ColorSpec2021 : ColorSpec
476476 . SetIsBackground ( true )
477477 . SetBackground ( HighestSurface )
478478 . SetContrastCurve ( _ => new ContrastCurve ( 1.0 , 1.0 , 3.0 , 4.5 ) )
479- . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryFixed , TertiaryFixedDim , 10.0 , TonePolarity . LIGHTER , true ) )
479+ . SetToneDeltaPair ( _ => new ToneDeltaPair ( TertiaryFixed , TertiaryFixedDim , 10.0 , TonePolarity . Lighter , true ) )
480480 . Build ( ) ;
481481
482482 public DynamicColor OnTertiaryFixed => new DynamicColor . Builder ( )
@@ -605,9 +605,9 @@ public double GetTone(DynamicScheme scheme, DynamicColor color)
605605 var polarity = toneDeltaPair . Polarity ;
606606 var stayTogether = toneDeltaPair . StayTogether ;
607607
608- var aIsNearer = ( polarity == TonePolarity . NEARER
609- || ( polarity == TonePolarity . LIGHTER && ! scheme . IsDark )
610- || ( polarity == TonePolarity . DARKER && ! scheme . IsDark ) ) ;
608+ var aIsNearer = ( polarity == TonePolarity . Nearer
609+ || ( polarity == TonePolarity . Lighter && ! scheme . IsDark )
610+ || ( polarity == TonePolarity . Darker && ! scheme . IsDark ) ) ;
611611 var nearer = aIsNearer ? roleA : roleB ;
612612 var farther = aIsNearer ? roleB : roleA ;
613613 var amNearer = color . name . Equals ( nearer . name , System . StringComparison . Ordinal ) ;
@@ -848,8 +848,5 @@ public TonalPalette GetNeutralVariantPalette(Variant variant, Hct sourceColorHct
848848 } ;
849849 }
850850
851- public TonalPalette ? GetErrorPalette ( Variant variant , Hct sourceColorHct , bool isDark , Platform platform , double contrastLevel )
852- {
853- return null ;
854- }
851+ public TonalPalette ? GetErrorPalette ( Variant variant , Hct sourceColorHct , bool isDark , Platform platform , double contrastLevel ) => null ;
855852}
0 commit comments