-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(artist): modularize page and add wikipedia section
- Loading branch information
Showing
13 changed files
with
693 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
extension ColorAlterer on Color { | ||
Color darken(double amount) { | ||
assert(amount >= 0 && amount <= 1); | ||
final hsl = HSLColor.fromColor(this); | ||
final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0)); | ||
return hslDark.toColor(); | ||
} | ||
|
||
Color lighten(double amount) { | ||
assert(amount >= 0 && amount <= 1); | ||
final hsl = HSLColor.fromColor(this); | ||
final hslLight = | ||
hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); | ||
return hslLight.toColor(); | ||
} | ||
|
||
bool isLight() { | ||
final luminance = computeLuminance(); | ||
return luminance > 0.5; | ||
} | ||
|
||
bool isDark() { | ||
final luminance = computeLuminance(); | ||
return luminance <= 0.5; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.