mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
fix: Color.darken fix
This commit is contained in:

committed by
Nathan Walker

parent
5084ef8795
commit
61c3a0a667
@ -363,7 +363,7 @@ export class Color implements definition.Color {
|
||||
public darken(amount: number) {
|
||||
amount = amount === 0 ? 0 : amount || 10;
|
||||
const hsl = rgbToHsl(this.r / 255, this.g / 255, this.b / 255);
|
||||
return Color.fromHSL(this.a, hsl.h * 360, hsl.s * 100, Math.min(100, Math.max(0, hsl.l - amount)));
|
||||
return Color.fromHSL(this.a, hsl.h * 360, hsl.s * 100, Math.min(100, Math.max(0, hsl.l * 100 - amount)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user