Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:[JIRA:HCPSDKFIORIUIKIT-2210] Add custom colors to FUIColorStyle #448

Merged
merged 4 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions Sources/FioriThemeManager/Colors/ColorStyle.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
public enum ColorStyle: String, CaseIterable {
// MARK: - Fiori Next Core Colors (110 Colors)
// MARK: - Fiori Next Core Colors (116 Colors)

// Core 1: Greys (1 - 11)
/// Grey 1
Expand Down Expand Up @@ -978,6 +978,38 @@ public enum ColorStyle: String, CaseIterable {
/// (light variant) ![](https://dummyimage.com/48x18/C45300.png&text=+) Hex value: C45300
case map10

// MARK: - Custom Colors (6 Styles)

/// Custom Color 1
/// (dark variant) ![](https://dummyimage.com/48x18/475E75.png&text=+) Hex value: 475E75FF
/// (light variant) ![](https://dummyimage.com/48x18/8396A8.png&text=+) Hex value: 8396A8FF
case customColor1

/// Custom Color 2
/// (dark variant) ![](https://dummyimage.com/48x18/0057D2.png&text=+) Hex value: 0057D2FF
/// (light variant) ![](https://dummyimage.com/48x18/1B90FF.png&text=+) Hex value: 1B90FFFF
case customColor2

/// Custom Color 3
/// (dark variant) ![](https://dummyimage.com/48x18/046C7A.png&text=+) Hex value: 046C7AFF
/// (light variant) ![](https://dummyimage.com/48x18/04ACA7.png&text=+) Hex value: 04ACA7FF
case customColor3

/// Custom Color 4
/// (dark variant) ![](https://dummyimage.com/48x18/256F3A.png&text=+) Hex value: 256F3AFF
/// (light variant) ![](https://dummyimage.com/48x18/36A41D.png&text=+) Hex value: 36A41DFF
case customColor4

/// Custom Color 5
/// (dark variant) ![](https://dummyimage.com/48x18/A93E00.png&text=+) Hex value: A93E00FF
/// (light variant) ![](https://dummyimage.com/48x18/F58B00.png&text=+) Hex value: F58B00FF
case customColor5

/// Custom Color 6
/// (dark variant) ![](https://dummyimage.com/48x18/D20A0A.png&text=+) Hex value: D20A0AFF
/// (light variant) ![](https://dummyimage.com/48x18/D20A0A.png&text=+) Hex value: D20A0AFF
case customColor6

/// EsriEdit
/// (dark variant) ![](https://dummyimage.com/48x18/1B6DD2.png&text=+) Hex value: 1B6DD2
/// (light variant) ![](https://dummyimage.com/48x18/FFF114.png&text=+) Hex value: FFF114
Expand Down Expand Up @@ -1240,5 +1272,5 @@ public enum ColorStyle: String, CaseIterable {
.footer, .cellBackground, .chart1, .chart2, .chart3, .chart4,
.chart5, .chart6, .chart7, .chart8, .chart9, .chart10, .chart11,
.stockUpStroke, .stockDownStroke, .map1, .map2, .map3, .map4,
.map5, .map6, .map7, .map8, .map9, .map10, .esriEdit]
.map5, .map6, .map7, .map8, .map9, .map10, .customColor1, .customColor2, .customColor3, .customColor4, .customColor5, .customColor6, .esriEdit]
}
6 changes: 6 additions & 0 deletions Sources/FioriThemeManager/Palettes/PaletteV7.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ struct PaletteV7: PaletteProvider {
.map8: HexColor(lightColor: "D0R774", darkColor: "D0R774"),
.map9: HexColor(lightColor: "1C857A", darkColor: "1C857A"),
.map10: HexColor(lightColor: "C45300", darkColor: "C45300"),
.customColor1: HexColor(lightColor: "475E75FF", darkColor: "8396A8FF", contrastLightColor: "344556FF", contrastDarkColor: "8799ABFF"),
.customColor2: HexColor(lightColor: "0057D2FF", darkColor: "1B90FFFF", contrastLightColor: "0046A8FF", contrastDarkColor: "2E99FFFF"),
.customColor3: HexColor(lightColor: "046C7AFF", darkColor: "04ACA7FF", contrastLightColor: "03535EFF", contrastDarkColor: "04ACA7FF"),
.customColor4: HexColor(lightColor: "256F3AFF", darkColor: "36A41DFF", contrastLightColor: "1B502AFF", contrastDarkColor: "39AD1FFF"),
.customColor5: HexColor(lightColor: "A93E00FF", darkColor: "F58B00FF", contrastLightColor: "7A2D00FF", contrastDarkColor: "F58B00FF"),
.customColor6: HexColor(lightColor: "D20A0AFF", darkColor: "D20A0AFF", contrastLightColor: "B40909FF", contrastDarkColor: "B40909FF"),
.esriEdit: HexColor(lightColor: "FFF114", darkColor: "1B6DD2")
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import XCTest

class ThemeManagerTests: XCTestCase {
func testLatestColorStyle() throws {
XCTAssertEqual(ColorStyle.allCases.count, 188)
XCTAssertEqual(ColorStyle.allCases.count, 194)
}

func testPaletteV7() throws {
let tm = ThemeManager.shared
tm.setPaletteVersion(.v7)
XCTAssertEqual(tm.paletteVersion?.supportedStyles().count, 190)
XCTAssertEqual(tm.paletteVersion?.supportedStyles().count, 196)
XCTAssertEqual(tm.paletteVersion?.obsoletedStyles().count, 0)
XCTAssertEqual(tm.paletteVersion?.newStyles().count, 56)
XCTAssertEqual(tm.paletteVersion?.newStyles().count, 62)
let newStyle_grey1 = tm.hexColor(for: .grey1)
XCTAssertEqual(newStyle_grey1, HexColor(lightColor: "12171CFF", darkColor: "F5F6F7FF", contrastLightColor: "1C242BFF", contrastDarkColor: "EAECEEFF"))
let newStyle_primaryLabel = tm.hexColor(for: .primaryLabel)
Expand Down