nativescript-material-core
Advanced tools
Comparing version 2.3.4 to 2.3.6
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.3.6](https://github.com/Akylas/nativescript-material-components/compare/v2.3.5...v2.3.6) (2019-07-19) | ||
**Note:** Version bump only for package nativescript-material-core | ||
## [2.3.4](https://github.com/Akylas/nativescript-material-components/compare/v2.3.3...v2.3.4) (2019-07-16) | ||
@@ -8,0 +16,0 @@ |
@@ -5,6 +5,19 @@ import { Color } from 'tns-core-modules/color'; | ||
export declare class Themer { | ||
primaryColor: string | Color; | ||
accentColor: string | Color; | ||
primaryColorVariant: string | Color; | ||
surfaceColor: string | Color; | ||
onSurfaceColor: string | Color; | ||
getOrcreateAppColorScheme(): void; | ||
getAppColorScheme(): void; | ||
setPrimaryColor(value: string): void; | ||
setPrimaryColorVariant(value: string): void; | ||
setPrimaryColor(value: string | Color): void; | ||
getPrimaryColor(): string | Color; | ||
setAccentColor(value: string | Color): void; | ||
getAccentColor(): string | Color; | ||
setSurfaceColor(value: string | Color): void; | ||
getSurfaceColor(): string | Color; | ||
setOnSurfaceColor(value: string | Color): void; | ||
getOnSurfaceColor(): string | Color; | ||
setPrimaryColorVariant(value: string | Color): void; | ||
getPrimaryColorVariant(): string | Color; | ||
} | ||
@@ -11,0 +24,0 @@ export declare const themer: Themer; |
@@ -21,7 +21,32 @@ "use strict"; | ||
Themer.prototype.setPrimaryColor = function (value) { | ||
// this.getOrcreateAppColorScheme().primaryColor = new Color(value).ios; | ||
this.primaryColor = value; | ||
}; | ||
Themer.prototype.getPrimaryColor = function () { | ||
return this.primaryColor; | ||
}; | ||
Themer.prototype.setAccentColor = function (value) { | ||
this.accentColor = value; | ||
}; | ||
Themer.prototype.getAccentColor = function () { | ||
return this.accentColor; | ||
}; | ||
Themer.prototype.setSurfaceColor = function (value) { | ||
this.surfaceColor = value; | ||
}; | ||
Themer.prototype.getSurfaceColor = function () { | ||
return this.surfaceColor; | ||
}; | ||
Themer.prototype.setOnSurfaceColor = function (value) { | ||
this.onSurfaceColor = value; | ||
; | ||
}; | ||
Themer.prototype.getOnSurfaceColor = function () { | ||
return this.onSurfaceColor; | ||
}; | ||
Themer.prototype.setPrimaryColorVariant = function (value) { | ||
// this.getOrcreateAppColorScheme().primaryColorVariant = new Color(value).ios; | ||
this.primaryColorVariant = value; | ||
}; | ||
Themer.prototype.getPrimaryColorVariant = function () { | ||
return this.primaryColorVariant; | ||
}; | ||
return Themer; | ||
@@ -42,2 +67,3 @@ }()); | ||
var temp = typeof color === 'string' ? new color_1.Color(color) : color; | ||
// return android.graphics.Color.argb(temp.a !== 255 ? temp.a / 255 : 0.14, temp.r / 255, temp.g / 255, temp.b); // default alpha is 0.14 | ||
return new color_1.Color(temp.a !== 255 ? temp.a : 36, temp.r, temp.g, temp.b).android; // default alpha is 0.14 | ||
@@ -44,0 +70,0 @@ } |
@@ -13,4 +13,12 @@ import { Color } from 'tns-core-modules/color'; | ||
getAppColorScheme(); | ||
setPrimaryColor(value: string); | ||
setPrimaryColorVariant(value: string); | ||
setPrimaryColor(value: string | Color); | ||
getPrimaryColor(): string | Color; | ||
setAccentColor(value: string | Color); | ||
getAccentColor(): string | Color; | ||
setPrimaryColorVariant(value: string | Color); | ||
getPrimaryColorVariant(): string | Color; | ||
setSurfaceColor(value: string | Color); | ||
getSurfaceColor(): string | Color; | ||
setOnSurfaceColor(value: string | Color); | ||
getOnSurfaceColor(): string | Color; | ||
} | ||
@@ -17,0 +25,0 @@ |
@@ -8,7 +8,20 @@ import { Color } from 'tns-core-modules/color'; | ||
appTypoScheme: MDCTypographyScheme; | ||
primaryColor: string | Color; | ||
accentColor: string | Color; | ||
primaryColorVariant: string | Color; | ||
surfaceColor: string | Color; | ||
onSurfaceColor: string | Color; | ||
constructor(); | ||
getOrcreateAppColorScheme(): MDCSemanticColorScheme; | ||
getAppColorScheme(): MDCSemanticColorScheme; | ||
setPrimaryColor(value: string): void; | ||
setPrimaryColorVariant(value: string): void; | ||
setPrimaryColor(value: string | Color): void; | ||
getPrimaryColor(): string | Color; | ||
setAccentColor(value: string | Color): void; | ||
getAccentColor(): string | Color; | ||
setSurfaceColor(value: string | Color): void; | ||
getSurfaceColor(): string | Color; | ||
setOnSurfaceColor(value: string | Color): void; | ||
getOnSurfaceColor(): string | Color; | ||
setPrimaryColorVariant(value: string | Color): void; | ||
getPrimaryColorVariant(): string | Color; | ||
getOrcreateAppTypographyScheme(): MDCTypographyScheme; | ||
@@ -15,0 +28,0 @@ getAppTypographyScheme(): MDCTypographyScheme; |
@@ -28,10 +28,44 @@ "use strict"; | ||
Themer.prototype.setPrimaryColor = function (value) { | ||
this.primaryColor = value; | ||
var colorTheme = this.getOrcreateAppColorScheme(); | ||
var color = new color_1.Color(value); | ||
var color = value instanceof color_1.Color ? value : new color_1.Color(value); | ||
colorTheme.primaryColor = color.ios; | ||
colorTheme.primaryColorVariant = new color_1.Color(61.2, color.r, color.g, color.b).ios; // default alpha is 0.24 | ||
}; | ||
Themer.prototype.getPrimaryColor = function () { | ||
return this.primaryColor; | ||
}; | ||
Themer.prototype.setAccentColor = function (value) { | ||
this.accentColor = value; | ||
}; | ||
Themer.prototype.getAccentColor = function () { | ||
return this.accentColor; | ||
}; | ||
Themer.prototype.setSurfaceColor = function (value) { | ||
this.surfaceColor = value; | ||
var colorTheme = this.getOrcreateAppColorScheme(); | ||
var color = value instanceof color_1.Color ? value : new color_1.Color(value); | ||
colorTheme.surfaceColor = color.ios; | ||
colorTheme.onSurfaceColor = color.ios; | ||
}; | ||
Themer.prototype.getSurfaceColor = function () { | ||
return this.surfaceColor; | ||
}; | ||
Themer.prototype.setOnSurfaceColor = function (value) { | ||
this.onSurfaceColor = value; | ||
var colorTheme = this.getOrcreateAppColorScheme(); | ||
var color = value instanceof color_1.Color ? value : new color_1.Color(value); | ||
colorTheme.onSurfaceColor = color.ios; | ||
}; | ||
Themer.prototype.getOnSurfaceColor = function () { | ||
return this.onSurfaceColor; | ||
}; | ||
Themer.prototype.setPrimaryColorVariant = function (value) { | ||
this.getOrcreateAppColorScheme().primaryColorVariant = new color_1.Color(value).ios; | ||
this.primaryColorVariant = value; | ||
var color = value instanceof color_1.Color ? value : new color_1.Color(value); | ||
this.getOrcreateAppColorScheme().primaryColorVariant = color.ios; | ||
}; | ||
Themer.prototype.getPrimaryColorVariant = function () { | ||
return this.primaryColorVariant; | ||
}; | ||
Themer.prototype.getOrcreateAppTypographyScheme = function () { | ||
@@ -68,2 +102,3 @@ if (!this.appTypoScheme) { | ||
var temp = typeof color === 'string' ? new color_1.Color(color) : color; | ||
// return UIColor.colorWithRedGreenBlueAlpha(temp.r / 255, temp.g / 255, temp.b, temp.a !== 255 ? temp.a / 255 : 0.14); | ||
return new color_1.Color(temp.a !== 255 ? temp.a : 36, temp.r, temp.g, temp.b).ios; // default alpha is 0.14 | ||
@@ -70,0 +105,0 @@ } |
{ | ||
"name": "nativescript-material-core", | ||
"version": "2.3.4", | ||
"version": "2.3.6", | ||
"description": "Material Core component", | ||
@@ -34,3 +34,3 @@ "main": "./core", | ||
"readmeFilename": "README.md", | ||
"gitHead": "58348bd805edd9139529e32182f2191216be4202" | ||
"gitHead": "c97ed4f8eaa577d8e6220c3ba7fbc044f53fd1cc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
111654
903