Skip to content

Commit

Permalink
Fluent colors for Mac (microsoft#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiuam authored Oct 12, 2020
1 parent 4c97b01 commit d1c4cac
Show file tree
Hide file tree
Showing 198 changed files with 442 additions and 79 deletions.
6 changes: 4 additions & 2 deletions MicrosoftFluentUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Pod::Spec.new do |s|

s.ios.deployment_target = "11.0"
s.ios.source_files = "ios/FluentUI/**/*.{swift,h}"
s.ios.resource_bundle = { 'FluentUIResources-ios' => "ios/FluentUI/**/*.{storyboard,xib,xcassets,strings,stringsdict}" }
s.ios.resource_bundle = { 'FluentUIResources-ios' => ["ios/FluentUI/**/*.{storyboard,xib,xcassets,strings,stringsdict}","apple/Resources/**/*.{json,xcassets}"] }


s.osx.deployment_target = "10.13"
s.osx.source_files = "macos/FluentUI/**/*.{swift,h}"
s.osx.resource_bundle = { 'FluentUIResources-macos' => "macos/FluentUIResources-macos/**/*.{storyboard,xib,xcassets,strings,stringsdict}" }
s.osx.resource_bundle = { 'FluentUIResources-macos' => ["macos/FluentUIResources-macos/**/*.{storyboard,xib,xcassets,strings,stringsdict}", "apple/Resources/**/*.{json,xcassets}"] }

end
12 changes: 10 additions & 2 deletions ios/FluentUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@
8FD011C1228A82A600D25925 /* ActivityIndicatorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E782C221793AB200A7DFCE /* ActivityIndicatorCell.swift */; };
8FD011C2228A82A600D25925 /* CenteredLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4E782C62179509A00A7DFCE /* CenteredLabelCell.swift */; };
8FD011C3228A82A600D25925 /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B498141321E424920077B48D /* TableViewCell.swift */; };
A257F82A251D98DD002CAA6E /* FluentUI-apple.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A257F829251D98DD002CAA6E /* FluentUI-apple.xcassets */; };
A257F82C251D98F3002CAA6E /* FluentUI-ios.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A257F82B251D98F3002CAA6E /* FluentUI-ios.xcassets */; };
A5237ACB21DED7030040BF27 /* ResizingHandleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5237ACA21DED7030040BF27 /* ResizingHandleView.swift */; };
A5237ACD21ED6CA70040BF27 /* DrawerShadowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5237ACC21ED6CA70040BF27 /* DrawerShadowView.swift */; };
A52648DC2316F4F9003342A0 /* BarButtonItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52648DB2316F4F9003342A0 /* BarButtonItems.swift */; };
A52648DD2316F4F9003342A0 /* BarButtonItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52648DB2316F4F9003342A0 /* BarButtonItems.swift */; };
A542A9D3226FBED900204A52 /* FluentUIResources-ios.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A5DA88FC226FAA01000A8EA8 /* FluentUIResources-ios.bundle */; platformFilter = ios; };
A542A9D7226FC01100204A52 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A559BB81212B6FA40055E107 /* Localizable.strings */; };
A542A9D8226FC01700204A52 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = A5DF1EAD2213B26900CC741A /* Localizable.stringsdict */; };
A542A9D9226FC01C00204A52 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A54D97DB217E5CED0072681A /* Assets.xcassets */; };
A54D97DA217A5FC10072681A /* CALayer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54D97D9217A5FC10072681A /* CALayer+Extensions.swift */; };
A559BB7E212B6D100055E107 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A559BB7D212B6D100055E107 /* String+Extension.swift */; };
A559BB83212B7D870055E107 /* FluentUIFramework.swift in Sources */ = {isa = PBXBuildFile; fileRef = A559BB82212B7D870055E107 /* FluentUIFramework.swift */; };
Expand Down Expand Up @@ -317,6 +318,9 @@
8AF03E1D24B6BDFB00E6E2A2 /* ContactCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactCollectionViewLayout.swift; sourceTree = "<group>"; };
8FA3CB5A246B19EA0049E431 /* ColorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorTests.swift; sourceTree = "<group>"; };
8FD01166228A820600D25925 /* libFluentUILib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFluentUILib.a; sourceTree = BUILT_PRODUCTS_DIR; };
A257F8182512C72C002CAA6E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ../apple/Resources/Assets.xcassets; sourceTree = "<group>"; };
A257F829251D98DD002CAA6E /* FluentUI-apple.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = "FluentUI-apple.xcassets"; path = "../apple/Resources/FluentUI-apple.xcassets"; sourceTree = "<group>"; };
A257F82B251D98F3002CAA6E /* FluentUI-ios.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = "FluentUI-ios.xcassets"; path = "FluentUI/Resources/FluentUI-ios.xcassets"; sourceTree = "<group>"; };
A5237ACA21DED7030040BF27 /* ResizingHandleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResizingHandleView.swift; sourceTree = "<group>"; };
A5237ACC21ED6CA70040BF27 /* DrawerShadowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DrawerShadowView.swift; sourceTree = "<group>"; };
A52648DB2316F4F9003342A0 /* BarButtonItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarButtonItems.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -610,6 +614,9 @@
A5CEC14720D980B20016922A = {
isa = PBXGroup;
children = (
A257F82B251D98F3002CAA6E /* FluentUI-ios.xcassets */,
A257F829251D98DD002CAA6E /* FluentUI-apple.xcassets */,
A257F8182512C72C002CAA6E /* Assets.xcassets */,
A5CEC15320D980B20016922A /* FluentUI */,
A5DA88FD226FAA01000A8EA8 /* FluentUI.Resources */,
A5CEC15E20D980B30016922A /* FluentUI.Tests */,
Expand Down Expand Up @@ -1138,9 +1145,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A542A9D9226FC01C00204A52 /* Assets.xcassets in Resources */,
A542A9D7226FC01100204A52 /* Localizable.strings in Resources */,
A542A9D8226FC01700204A52 /* Localizable.stringsdict in Resources */,
A257F82A251D98DD002CAA6E /* FluentUI-apple.xcassets in Resources */,
A257F82C251D98F3002CAA6E /* FluentUI-ios.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
96 changes: 48 additions & 48 deletions ios/FluentUI/Core/Colors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ public final class Colors: NSObject {
case gray40
case gray30
case gray20
case gray12
case gray11
case gray10
case gray9
case gray8
case gray7
case gray6
case gray5
case gray4
case gray3
case gray2
case gray1
case gray25
case gray50
case gray100
case gray200
case gray300
case gray400
case gray500
case gray600
case gray700
case gray800
case gray900
case gray950
case communicationBlue
case communicationBlueTint40
case communicationBlueTint30
Expand Down Expand Up @@ -165,30 +165,30 @@ public final class Colors: NSObject {
return "gray30"
case .gray20:
return "gray20"
case .gray12:
return "gray12"
case .gray11:
return "gray11"
case .gray10:
return "gray10"
case .gray9:
return "gray9"
case .gray8:
return "gray8"
case .gray7:
return "gray7"
case .gray6:
return "gray6"
case .gray5:
return "gray5"
case .gray4:
return "gray4"
case .gray3:
return "gray3"
case .gray2:
return "gray2"
case .gray1:
return "gray1"
case .gray25:
return "gray25"
case .gray50:
return "gray50"
case .gray100:
return "gray100"
case .gray200:
return "gray200"
case .gray300:
return "gray300"
case .gray400:
return "gray400"
case .gray500:
return "gray500"
case .gray600:
return "gray600"
case .gray700:
return "gray700"
case .gray800:
return "gray800"
case .gray900:
return "gray900"
case .gray950:
return "gray950"
case .communicationBlue:
return "communicationBlue"
case .communicationBlueTint40:
Expand Down Expand Up @@ -345,18 +345,18 @@ public final class Colors: NSObject {

// MARK: Physical - grays

@objc public static let gray950: UIColor = Palette.gray1.color
@objc public static let gray900: UIColor = Palette.gray2.color
@objc public static let gray800: UIColor = Palette.gray3.color
@objc public static let gray700: UIColor = Palette.gray4.color
@objc public static let gray600: UIColor = Palette.gray5.color
@objc public static let gray500: UIColor = Palette.gray6.color
@objc public static let gray400: UIColor = Palette.gray7.color
@objc public static let gray300: UIColor = Palette.gray8.color
@objc public static let gray200: UIColor = Palette.gray9.color
@objc public static let gray100: UIColor = Palette.gray10.color
@objc public static let gray50: UIColor = Palette.gray11.color
@objc public static let gray25: UIColor = Palette.gray12.color
@objc public static let gray950: UIColor = Palette.gray950.color
@objc public static let gray900: UIColor = Palette.gray900.color
@objc public static let gray800: UIColor = Palette.gray800.color
@objc public static let gray700: UIColor = Palette.gray700.color
@objc public static let gray600: UIColor = Palette.gray600.color
@objc public static let gray500: UIColor = Palette.gray500.color
@objc public static let gray400: UIColor = Palette.gray400.color
@objc public static let gray300: UIColor = Palette.gray300.color
@objc public static let gray200: UIColor = Palette.gray200.color
@objc public static let gray100: UIColor = Palette.gray100.color
@objc public static let gray50: UIColor = Palette.gray50.color
@objc public static let gray25: UIColor = Palette.gray25.color

// MARK: Physical - Non-grays

Expand Down
35 changes: 21 additions & 14 deletions macos/FluentUI/AvatarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,27 @@ fileprivate extension NSColor {

/// the table of background colors for the initials views
static let avatarBackgroundColors: [NSColor] = [
#colorLiteral(red: 0.6, green: 0.71, blue: 0.2, alpha: 1),
#colorLiteral(red: 0.42, green: 0.65, blue: 0.91, alpha: 1),
#colorLiteral(red: 0.91, green: 0.45, blue: 0.74, alpha: 1),
#colorLiteral(red: 0.0, green: 0.64, blue: 0.0, alpha: 1),
#colorLiteral(red: 0.12, green: 0.44, blue: 0.27, alpha: 1),
#colorLiteral(red: 1.0, green: 0.0, blue: 0.59, alpha: 1),
#colorLiteral(red: 0.49, green: 0.22, blue: 0.47, alpha: 1),
#colorLiteral(red: 0.38, green: 0.24, blue: 0.73, alpha: 1),
#colorLiteral(red: 0.0, green: 0.67, blue: 0.66, alpha: 1),
#colorLiteral(red: 0.18, green: 0.54, blue: 0.94, alpha: 1),
#colorLiteral(red: 0.17, green: 0.34, blue: 0.59, alpha: 1),
#colorLiteral(red: 0.85, green: 0.32, blue: 0.17, alpha: 1),
#colorLiteral(red: 0.72, green: 0.11, blue: 0.28, alpha: 1),
#colorLiteral(red: 0.93, green: 0.07, blue: 0.07, alpha: 1),
Colors.Palette.cyanBlue10.color,
Colors.Palette.red10.color,
Colors.Palette.magenta20.color,
Colors.Palette.green10.color,
Colors.Palette.magentaPink10.color,
Colors.Palette.cyanBlue20.color,
Colors.Palette.orange20.color,
Colors.Palette.cyan20.color,
Colors.Palette.orangeYellow20.color,
Colors.Palette.red20.color,
Colors.Palette.blue10.color,
Colors.Palette.magenta10.color,
Colors.Palette.gray40.color,
Colors.Palette.green20.color,
Colors.Palette.blueMagenta20.color,
Colors.Palette.pinkRed10.color,
Colors.Palette.gray30.color,
Colors.Palette.blueMagenta30.color,
Colors.Palette.gray20.color,
Colors.Palette.cyan30.color,
Colors.Palette.orange30.color
]
}

Expand Down
Loading

0 comments on commit d1c4cac

Please sign in to comment.