meemup-library 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,11 @@ declare class ColorController {
31
31
  * @returns رنگ متن متناظر (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
32
32
  */
33
33
  generateContrastColorForBackground(background_color: string | null, default_text_color?: string): string;
34
- generateColorForPosProduct(product: IProduct, setting: IPointOfSaleSetting, defaultBackgroundColor: any, defaultTextColor: any): {
34
+ generateColorForPos(color: string | null, coloredTiles: boolean, defaultBackgroundColor: any, defaultTextColor: any): {
35
+ backgroundColor: any;
36
+ textColor: any;
37
+ };
38
+ generateColorForPosProduct(product: IProduct, coloredTiles: boolean, defaultBackgroundColor: any, defaultTextColor: any): {
35
39
  backgroundColor: any;
36
40
  textColor: any;
37
41
  };
@@ -86,10 +86,19 @@ class ColorController {
86
86
  // اگر هیچکدام از فرمت‌های بالا نبود، رنگ سیاه را برگردانید
87
87
  return default_text_color;
88
88
  }
89
- generateColorForPosProduct(product, setting, defaultBackgroundColor, defaultTextColor) {
89
+ generateColorForPos(color, coloredTiles, defaultBackgroundColor, defaultTextColor) {
90
90
  let textColor = defaultTextColor;
91
91
  let backgroundColor = defaultBackgroundColor;
92
- if (setting.coloredTiles) {
92
+ if (coloredTiles) {
93
+ textColor = this.generateContrastColorForBackground(color, defaultTextColor);
94
+ backgroundColor = textColor === defaultTextColor ? defaultBackgroundColor : color;
95
+ }
96
+ return { backgroundColor, textColor };
97
+ }
98
+ generateColorForPosProduct(product, coloredTiles, defaultBackgroundColor, defaultTextColor) {
99
+ let textColor = defaultTextColor;
100
+ let backgroundColor = defaultBackgroundColor;
101
+ if (coloredTiles) {
93
102
  textColor = this.generateContrastColorForBackground(product.color, defaultTextColor);
94
103
  backgroundColor = textColor === defaultTextColor ? defaultBackgroundColor : product.color;
95
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "remove:one": "rimraf dist",
12
12
  "remove:two": "rimraf ./src/dist",
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "commit": "git add . && git commit -m \"version.1.2.11\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.2.13\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"