@nativescript-community/ui-material-core
Advanced tools
Comparing version 7.2.15 to 7.2.16
@@ -10,2 +10,4 @@ import { Color } from '@nativescript/core'; | ||
primaryColor: string | Color; | ||
backgroundColor: string | Color; | ||
onBackgroundColor: string | Color; | ||
onPrimaryColor: string | Color; | ||
@@ -34,2 +36,6 @@ secondaryColor: string | Color; | ||
getPrimaryColorVariant(): string | Color; | ||
setBackgroundColor(value: string | Color): void; | ||
getBackgroundColor(): string | Color; | ||
setOnBackgroundColor(value: string | Color): void; | ||
getOnBackgroundColor(): string | Color; | ||
getOrcreateAppTypographyScheme(): MDCTypographyScheme; | ||
@@ -36,0 +42,0 @@ getAppTypographyScheme(): MDCTypographyScheme; |
@@ -45,2 +45,5 @@ import { Background, Button, Color, ControlStateChangeListener, CoreTypes, GestureTypes, PercentLength, TouchAction, Utils, View, backgroundInternalProperty } from '@nativescript/core'; | ||
} | ||
function getIOSColor(value) { | ||
return (value instanceof Color ? value : new Color(value)).ios; | ||
} | ||
export class Themer { | ||
@@ -67,4 +70,3 @@ constructor() { | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
const color = value instanceof Color ? value : new Color(value); | ||
colorTheme.primaryColor = color.ios; | ||
colorTheme.primaryColor = getIOSColor(value); | ||
this.appColorScheme.primaryColorVariant = this.appColorScheme.primaryColor.colorWithAlphaComponent(0.24); | ||
@@ -78,4 +80,3 @@ } | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
const color = value instanceof Color ? value : new Color(value); | ||
colorTheme.onPrimaryColor = color.ios; | ||
colorTheme.onPrimaryColor = getIOSColor(value); | ||
} | ||
@@ -88,4 +89,3 @@ getOnPrimaryColor() { | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
const color = value instanceof Color ? value : new Color(value); | ||
colorTheme.secondaryColor = color.ios; | ||
colorTheme.secondaryColor = getIOSColor(value); | ||
} | ||
@@ -104,5 +104,5 @@ getSecondaryColor() { | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
const color = value instanceof Color ? value : new Color(value); | ||
colorTheme.surfaceColor = color.ios; | ||
colorTheme.onSurfaceColor = color.ios; | ||
const color = getIOSColor(value); | ||
colorTheme.surfaceColor = color; | ||
colorTheme.onSurfaceColor = color; | ||
} | ||
@@ -115,4 +115,3 @@ getSurfaceColor() { | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
const color = value instanceof Color ? value : new Color(value); | ||
colorTheme.onSurfaceColor = color.ios; | ||
colorTheme.onSurfaceColor = getIOSColor(value); | ||
} | ||
@@ -124,4 +123,3 @@ getOnSurfaceColor() { | ||
this.primaryColorVariant = value; | ||
const color = value instanceof Color ? value : new Color(value); | ||
this.getOrcreateAppColorScheme().primaryColorVariant = color.ios; | ||
this.getOrcreateAppColorScheme().primaryColorVariant = getIOSColor(value); | ||
} | ||
@@ -131,2 +129,18 @@ getPrimaryColorVariant() { | ||
} | ||
setBackgroundColor(value) { | ||
this.backgroundColor = value; | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
colorTheme.backgroundColor = getIOSColor(value); | ||
} | ||
getBackgroundColor() { | ||
return this.backgroundColor; | ||
} | ||
setOnBackgroundColor(value) { | ||
this.onBackgroundColor = value; | ||
const colorTheme = this.getOrcreateAppColorScheme(); | ||
colorTheme.onBackgroundColor = getIOSColor(value); | ||
} | ||
getOnBackgroundColor() { | ||
return this.onBackgroundColor; | ||
} | ||
getOrcreateAppTypographyScheme() { | ||
@@ -187,3 +201,4 @@ if (!this.appTypoScheme) { | ||
} | ||
return temp.setAlpha(alpha).ios; | ||
// TODO: we cant use setAlpha until it is fixed in Nativescript or ios will be undefined | ||
return new Color(alpha || 61.5, temp.r, temp.g, temp.b).ios; | ||
} | ||
@@ -190,0 +205,0 @@ return null; |
{ | ||
"name": "@nativescript-community/ui-material-core", | ||
"version": "7.2.15", | ||
"version": "7.2.16", | ||
"description": "Material Core component", | ||
@@ -41,3 +41,3 @@ "main": "./index", | ||
"readmeFilename": "README.md", | ||
"gitHead": "7bc0953663c10c24f86123ec72e6a28886ed5aea" | ||
"gitHead": "fd1ccbbfcc2aab5d8f6993cee94b98597cf9580f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120701
1514