Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2020-03-10 13:28:15 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aaf21e771b58d63aeade7eadce4dad7ab63f2ed9
aaf21e77
1 parent
6d488473
Add PdfColor.shade
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
pdf/CHANGELOG.md
pdf/lib/src/color.dart
pdf/CHANGELOG.md
View file @
aaf21e7
...
...
@@ -7,6 +7,7 @@
-
Improve Internal data structure
-
Remove deprecated functions
-
Optimize file size
-
Add PdfColor.shade
## 1.5.0
...
...
pdf/lib/src/color.dart
View file @
aaf21e7
...
...
@@ -141,6 +141,17 @@ class PdfColor {
return
0.2126
*
R
+
0.7152
*
G
+
0.0722
*
B
;
}
/// Build a Material Color shade using the given [strength].
///
/// To lighten a color, set the [strength] value to < .5
/// To darken a color, set the [strength] value to > .5
PdfColor
shade
(
double
strength
)
{
final
double
ds
=
1.5
-
strength
;
final
PdfColorHsl
hsl
=
toHsl
();
return
PdfColorHsl
(
hsl
.
hue
,
hsl
.
saturation
,
hsl
.
lightness
*
ds
);
}
/// Get a complementary color with hue shifted by -120°
PdfColor
get
complementary
=>
toHsv
().
complementary
;
...
...
Please
register
or
login
to post a comment