@@ -402,7 +402,7 @@ open class AvatarView: NSView {
402
402
/// - returns: the color table entry for the given index
403
403
@objc ( getColorForIndex: )
404
404
@available ( * , deprecated, message: " Use getInitialsColorSetFromPrimaryText:secondaryText: instead " )
405
- public static func getColor( for index: Int ) -> ColorSet {
405
+ public static func getColor( for index: Int ) -> LegacyColorSet {
406
406
let avatarBackgroundColors = AvatarView . avatarColors
407
407
return avatarBackgroundColors [ index % avatarBackgroundColors. count]
408
408
}
@@ -524,7 +524,7 @@ open class AvatarView: NSView {
524
524
///
525
525
/// - Returns: The calculated `ColorSet` for the provided text values.
526
526
@objc ( getInitialsColorSetFromPrimaryText: secondaryText: )
527
- public static func getInitialsColorSet( fromPrimaryText primaryText: String ? , secondaryText: String ? ) -> ColorSet {
527
+ public static func getInitialsColorSet( fromPrimaryText primaryText: String ? , secondaryText: String ? ) -> LegacyColorSet {
528
528
// Set the color based on the primary text and secondary text
529
529
let combined = ( primaryText ?? " " ) + ( secondaryText ?? " " )
530
530
let combinedHashable = combined as NSString
@@ -636,67 +636,127 @@ extension AvatarView {
636
636
]
637
637
638
638
/// Table of background and text colors for the AvatarView
639
- static let avatarColors : [ ColorSet ] = [
640
- ColorSet ( background: DynamicColor ( light: Colors . Palette. darkRedTint40. color, dark: Colors . Palette. darkRedShade30. color) ,
641
- foreground: DynamicColor ( light: Colors . Palette. darkRedShade30. color, dark: Colors . Palette. darkRedTint40. color) ) ,
642
- ColorSet ( background: DynamicColor ( light: Colors . Palette. cranberryTint40. color, dark: Colors . Palette. cranberryShade30. color) ,
643
- foreground: DynamicColor ( light: Colors . Palette. cranberryShade30. color, dark: Colors . Palette. cranberryTint40. color) ) ,
644
- ColorSet ( background: DynamicColor ( light: Colors . Palette. redTint40. color, dark: Colors . Palette. redShade30. color) ,
645
- foreground: DynamicColor ( light: Colors . Palette. redShade30. color, dark: Colors . Palette. redTint40. color) ) ,
646
- ColorSet ( background: DynamicColor ( light: Colors . Palette. pumpkinTint40. color, dark: Colors . Palette. pumpkinShade30. color) ,
647
- foreground: DynamicColor ( light: Colors . Palette. pumpkinShade30. color, dark: Colors . Palette. pumpkinTint40. color) ) ,
648
- ColorSet ( background: DynamicColor ( light: Colors . Palette. peachTint40. color, dark: Colors . Palette. peachShade30. color) ,
649
- foreground: DynamicColor ( light: Colors . Palette. peachShade30. color, dark: Colors . Palette. peachTint40. color) ) ,
650
- ColorSet ( background: DynamicColor ( light: Colors . Palette. marigoldTint40. color, dark: Colors . Palette. marigoldShade30. color) ,
651
- foreground: DynamicColor ( light: Colors . Palette. marigoldShade30. color, dark: Colors . Palette. marigoldTint40. color) ) ,
652
- ColorSet ( background: DynamicColor ( light: Colors . Palette. goldTint40. color, dark: Colors . Palette. goldShade30. color) ,
653
- foreground: DynamicColor ( light: Colors . Palette. goldShade30. color, dark: Colors . Palette. goldTint40. color) ) ,
654
- ColorSet ( background: DynamicColor ( light: Colors . Palette. brassTint40. color, dark: Colors . Palette. brassShade30. color) ,
655
- foreground: DynamicColor ( light: Colors . Palette. brassShade30. color, dark: Colors . Palette. brassTint40. color) ) ,
656
- ColorSet ( background: DynamicColor ( light: Colors . Palette. brownTint40. color, dark: Colors . Palette. brownShade30. color) ,
657
- foreground: DynamicColor ( light: Colors . Palette. brownShade30. color, dark: Colors . Palette. brownTint40. color) ) ,
658
- ColorSet ( background: DynamicColor ( light: Colors . Palette. forestTint40. color, dark: Colors . Palette. forestShade30. color) ,
659
- foreground: DynamicColor ( light: Colors . Palette. forestShade30. color, dark: Colors . Palette. forestTint40. color) ) ,
660
- ColorSet ( background: DynamicColor ( light: Colors . Palette. seafoamTint40. color, dark: Colors . Palette. seafoamShade30. color) ,
661
- foreground: DynamicColor ( light: Colors . Palette. seafoamShade30. color, dark: Colors . Palette. seafoamTint40. color) ) ,
662
- ColorSet ( background: DynamicColor ( light: Colors . Palette. darkGreenTint40. color, dark: Colors . Palette. darkGreenShade30. color) ,
663
- foreground: DynamicColor ( light: Colors . Palette. darkGreenShade30. color, dark: Colors . Palette. darkGreenTint40. color) ) ,
664
- ColorSet ( background: DynamicColor ( light: Colors . Palette. lightTealTint40. color, dark: Colors . Palette. lightTealShade30. color) ,
665
- foreground: DynamicColor ( light: Colors . Palette. lightTealShade30. color, dark: Colors . Palette. lightTealTint40. color) ) ,
666
- ColorSet ( background: DynamicColor ( light: Colors . Palette. tealTint40. color, dark: Colors . Palette. tealShade30. color) ,
667
- foreground: DynamicColor ( light: Colors . Palette. tealShade30. color, dark: Colors . Palette. tealTint40. color) ) ,
668
- ColorSet ( background: DynamicColor ( light: Colors . Palette. steelTint40. color, dark: Colors . Palette. steelShade30. color) ,
669
- foreground: DynamicColor ( light: Colors . Palette. steelShade30. color, dark: Colors . Palette. steelTint40. color) ) ,
670
- ColorSet ( background: DynamicColor ( light: Colors . Palette. blueTint40. color, dark: Colors . Palette. blueShade30. color) ,
671
- foreground: DynamicColor ( light: Colors . Palette. blueShade30. color, dark: Colors . Palette. blueTint40. color) ) ,
672
- ColorSet ( background: DynamicColor ( light: Colors . Palette. royalBlueTint40. color, dark: Colors . Palette. royalBlueShade30. color) ,
673
- foreground: DynamicColor ( light: Colors . Palette. royalBlueShade30. color, dark: Colors . Palette. royalBlueTint40. color) ) ,
674
- ColorSet ( background: DynamicColor ( light: Colors . Palette. cornFlowerTint40. color, dark: Colors . Palette. cornFlowerShade30. color) ,
675
- foreground: DynamicColor ( light: Colors . Palette. cornFlowerShade30. color, dark: Colors . Palette. cornFlowerTint40. color) ) ,
676
- ColorSet ( background: DynamicColor ( light: Colors . Palette. navyTint40. color, dark: Colors . Palette. navyShade30. color) ,
677
- foreground: DynamicColor ( light: Colors . Palette. navyShade30. color, dark: Colors . Palette. navyTint40. color) ) ,
678
- ColorSet ( background: DynamicColor ( light: Colors . Palette. lavenderTint40. color, dark: Colors . Palette. lavenderShade30. color) ,
679
- foreground: DynamicColor ( light: Colors . Palette. lavenderShade30. color, dark: Colors . Palette. lavenderTint40. color) ) ,
680
- ColorSet ( background: DynamicColor ( light: Colors . Palette. purpleTint40. color, dark: Colors . Palette. purpleShade30. color) ,
681
- foreground: DynamicColor ( light: Colors . Palette. purpleShade30. color, dark: Colors . Palette. purpleTint40. color) ) ,
682
- ColorSet ( background: DynamicColor ( light: Colors . Palette. grapeTint40. color, dark: Colors . Palette. grapeShade30. color) ,
683
- foreground: DynamicColor ( light: Colors . Palette. grapeShade30. color, dark: Colors . Palette. grapeTint40. color) ) ,
684
- ColorSet ( background: DynamicColor ( light: Colors . Palette. lilacTint40. color, dark: Colors . Palette. lilacShade30. color) ,
685
- foreground: DynamicColor ( light: Colors . Palette. lilacShade30. color, dark: Colors . Palette. lilacTint40. color) ) ,
686
- ColorSet ( background: DynamicColor ( light: Colors . Palette. pinkTint40. color, dark: Colors . Palette. pinkShade30. color) ,
687
- foreground: DynamicColor ( light: Colors . Palette. pinkShade30. color, dark: Colors . Palette. pinkTint40. color) ) ,
688
- ColorSet ( background: DynamicColor ( light: Colors . Palette. magentaTint40. color, dark: Colors . Palette. magentaShade30. color) ,
689
- foreground: DynamicColor ( light: Colors . Palette. magentaShade30. color, dark: Colors . Palette. magentaTint40. color) ) ,
690
- ColorSet ( background: DynamicColor ( light: Colors . Palette. plumTint40. color, dark: Colors . Palette. plumShade30. color) ,
691
- foreground: DynamicColor ( light: Colors . Palette. plumShade30. color, dark: Colors . Palette. plumTint40. color) ) ,
692
- ColorSet ( background: DynamicColor ( light: Colors . Palette. beigeTint40. color, dark: Colors . Palette. beigeShade30. color) ,
693
- foreground: DynamicColor ( light: Colors . Palette. beigeShade30. color, dark: Colors . Palette. beigeTint40. color) ) ,
694
- ColorSet ( background: DynamicColor ( light: Colors . Palette. minkTint40. color, dark: Colors . Palette. minkShade30. color) ,
695
- foreground: DynamicColor ( light: Colors . Palette. minkShade30. color, dark: Colors . Palette. minkTint40. color) ) ,
696
- ColorSet ( background: DynamicColor ( light: Colors . Palette. platinumTint40. color, dark: Colors . Palette. platinumShade30. color) ,
697
- foreground: DynamicColor ( light: Colors . Palette. platinumShade30. color, dark: Colors . Palette. platinumTint40. color) ) ,
698
- ColorSet ( background: DynamicColor ( light: Colors . Palette. anchorTint40. color, dark: Colors . Palette. anchorShade30. color) ,
699
- foreground: DynamicColor ( light: Colors . Palette. anchorShade30. color, dark: Colors . Palette. anchorTint40. color) )
639
+ static let avatarColors : [ LegacyColorSet ] = [
640
+ . init( background: . init( light: Colors . Palette. darkRedTint40. color,
641
+ dark: Colors . Palette. darkRedShade30. color) ,
642
+ foreground: . init( light: Colors . Palette. darkRedShade30. color,
643
+ dark: Colors . Palette. darkRedTint40. color) ) ,
644
+ . init( background: . init( light: Colors . Palette. cranberryTint40. color,
645
+ dark: Colors . Palette. cranberryShade30. color) ,
646
+ foreground: . init( light: Colors . Palette. cranberryShade30. color,
647
+ dark: Colors . Palette. cranberryTint40. color) ) ,
648
+ . init( background: . init( light: Colors . Palette. redTint40. color,
649
+ dark: Colors . Palette. redShade30. color) ,
650
+ foreground: . init( light: Colors . Palette. redShade30. color,
651
+ dark: Colors . Palette. redTint40. color) ) ,
652
+ . init( background: . init( light: Colors . Palette. pumpkinTint40. color,
653
+ dark: Colors . Palette. pumpkinShade30. color) ,
654
+ foreground: . init( light: Colors . Palette. pumpkinShade30. color,
655
+ dark: Colors . Palette. pumpkinTint40. color) ) ,
656
+ . init( background: . init( light: Colors . Palette. peachTint40. color,
657
+ dark: Colors . Palette. peachShade30. color) ,
658
+ foreground: . init( light: Colors . Palette. peachShade30. color,
659
+ dark: Colors . Palette. peachTint40. color) ) ,
660
+ . init( background: . init( light: Colors . Palette. marigoldTint40. color,
661
+ dark: Colors . Palette. marigoldShade30. color) ,
662
+ foreground: . init( light: Colors . Palette. marigoldShade30. color,
663
+ dark: Colors . Palette. marigoldTint40. color) ) ,
664
+ . init( background: . init( light: Colors . Palette. goldTint40. color,
665
+ dark: Colors . Palette. goldShade30. color) ,
666
+ foreground: . init( light: Colors . Palette. goldShade30. color,
667
+ dark: Colors . Palette. goldTint40. color) ) ,
668
+ . init( background: . init( light: Colors . Palette. brassTint40. color,
669
+ dark: Colors . Palette. brassShade30. color) ,
670
+ foreground: . init( light: Colors . Palette. brassShade30. color,
671
+ dark: Colors . Palette. brassTint40. color) ) ,
672
+ . init( background: . init( light: Colors . Palette. brownTint40. color,
673
+ dark: Colors . Palette. brownShade30. color) ,
674
+ foreground: . init( light: Colors . Palette. brownShade30. color,
675
+ dark: Colors . Palette. brownTint40. color) ) ,
676
+ . init( background: . init( light: Colors . Palette. forestTint40. color,
677
+ dark: Colors . Palette. forestShade30. color) ,
678
+ foreground: . init( light: Colors . Palette. forestShade30. color,
679
+ dark: Colors . Palette. forestTint40. color) ) ,
680
+ . init( background: . init( light: Colors . Palette. seafoamTint40. color,
681
+ dark: Colors . Palette. seafoamShade30. color) ,
682
+ foreground: . init( light: Colors . Palette. seafoamShade30. color,
683
+ dark: Colors . Palette. seafoamTint40. color) ) ,
684
+ . init( background: . init( light: Colors . Palette. darkGreenTint40. color,
685
+ dark: Colors . Palette. darkGreenShade30. color) ,
686
+ foreground: . init( light: Colors . Palette. darkGreenShade30. color,
687
+ dark: Colors . Palette. darkGreenTint40. color) ) ,
688
+ . init( background: . init( light: Colors . Palette. lightTealTint40. color,
689
+ dark: Colors . Palette. lightTealShade30. color) ,
690
+ foreground: . init( light: Colors . Palette. lightTealShade30. color,
691
+ dark: Colors . Palette. lightTealTint40. color) ) ,
692
+ . init( background: . init( light: Colors . Palette. tealTint40. color,
693
+ dark: Colors . Palette. tealShade30. color) ,
694
+ foreground: . init( light: Colors . Palette. tealShade30. color,
695
+ dark: Colors . Palette. tealTint40. color) ) ,
696
+ . init( background: . init( light: Colors . Palette. steelTint40. color,
697
+ dark: Colors . Palette. steelShade30. color) ,
698
+ foreground: . init( light: Colors . Palette. steelShade30. color,
699
+ dark: Colors . Palette. steelTint40. color) ) ,
700
+ . init( background: . init( light: Colors . Palette. blueTint40. color,
701
+ dark: Colors . Palette. blueShade30. color) ,
702
+ foreground: . init( light: Colors . Palette. blueShade30. color,
703
+ dark: Colors . Palette. blueTint40. color) ) ,
704
+ . init( background: . init( light: Colors . Palette. royalBlueTint40. color,
705
+ dark: Colors . Palette. royalBlueShade30. color) ,
706
+ foreground: . init( light: Colors . Palette. royalBlueShade30. color,
707
+ dark: Colors . Palette. royalBlueTint40. color) ) ,
708
+ . init( background: . init( light: Colors . Palette. cornFlowerTint40. color,
709
+ dark: Colors . Palette. cornFlowerShade30. color) ,
710
+ foreground: . init( light: Colors . Palette. cornFlowerShade30. color,
711
+ dark: Colors . Palette. cornFlowerTint40. color) ) ,
712
+ . init( background: . init( light: Colors . Palette. navyTint40. color,
713
+ dark: Colors . Palette. navyShade30. color) ,
714
+ foreground: . init( light: Colors . Palette. navyShade30. color,
715
+ dark: Colors . Palette. navyTint40. color) ) ,
716
+ . init( background: . init( light: Colors . Palette. lavenderTint40. color,
717
+ dark: Colors . Palette. lavenderShade30. color) ,
718
+ foreground: . init( light: Colors . Palette. lavenderShade30. color,
719
+ dark: Colors . Palette. lavenderTint40. color) ) ,
720
+ . init( background: . init( light: Colors . Palette. purpleTint40. color,
721
+ dark: Colors . Palette. purpleShade30. color) ,
722
+ foreground: . init( light: Colors . Palette. purpleShade30. color,
723
+ dark: Colors . Palette. purpleTint40. color) ) ,
724
+ . init( background: . init( light: Colors . Palette. grapeTint40. color,
725
+ dark: Colors . Palette. grapeShade30. color) ,
726
+ foreground: . init( light: Colors . Palette. grapeShade30. color,
727
+ dark: Colors . Palette. grapeTint40. color) ) ,
728
+ . init( background: . init( light: Colors . Palette. lilacTint40. color,
729
+ dark: Colors . Palette. lilacShade30. color) ,
730
+ foreground: . init( light: Colors . Palette. lilacShade30. color,
731
+ dark: Colors . Palette. lilacTint40. color) ) ,
732
+ . init( background: . init( light: Colors . Palette. pinkTint40. color,
733
+ dark: Colors . Palette. pinkShade30. color) ,
734
+ foreground: . init( light: Colors . Palette. pinkShade30. color,
735
+ dark: Colors . Palette. pinkTint40. color) ) ,
736
+ . init( background: . init( light: Colors . Palette. magentaTint40. color,
737
+ dark: Colors . Palette. magentaShade30. color) ,
738
+ foreground: . init( light: Colors . Palette. magentaShade30. color,
739
+ dark: Colors . Palette. magentaTint40. color) ) ,
740
+ . init( background: . init( light: Colors . Palette. plumTint40. color,
741
+ dark: Colors . Palette. plumShade30. color) ,
742
+ foreground: . init( light: Colors . Palette. plumShade30. color,
743
+ dark: Colors . Palette. plumTint40. color) ) ,
744
+ . init( background: . init( light: Colors . Palette. beigeTint40. color,
745
+ dark: Colors . Palette. beigeShade30. color) ,
746
+ foreground: . init( light: Colors . Palette. beigeShade30. color,
747
+ dark: Colors . Palette. beigeTint40. color) ) ,
748
+ . init( background: . init( light: Colors . Palette. minkTint40. color,
749
+ dark: Colors . Palette. minkShade30. color) ,
750
+ foreground: . init( light: Colors . Palette. minkShade30. color,
751
+ dark: Colors . Palette. minkTint40. color) ) ,
752
+ . init( background: . init( light: Colors . Palette. platinumTint40. color,
753
+ dark: Colors . Palette. platinumShade30. color) ,
754
+ foreground: . init( light: Colors . Palette. platinumShade30. color,
755
+ dark: Colors . Palette. platinumTint40. color) ) ,
756
+ . init( background: . init( light: Colors . Palette. anchorTint40. color,
757
+ dark: Colors . Palette. anchorShade30. color) ,
758
+ foreground: . init( light: Colors . Palette. anchorShade30. color,
759
+ dark: Colors . Palette. anchorTint40. color) )
700
760
]
701
761
}
702
762
0 commit comments