-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Alex Li <[email protected]>
- Loading branch information
Showing
5 changed files
with
40 additions
and
2 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
20 changes: 20 additions & 0 deletions
20
image_editor_platform_interface/test/color_option_test.dart
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,20 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:image_editor_platform_interface/src/option/edit_options.dart'; | ||
|
||
void main() { | ||
test('contrast = 1 should give us the default matrix', () { | ||
expect(ColorOption.contrast(1).matrix, defaultColorMatrix); | ||
}); | ||
test( | ||
'contrast = 0 should have zeros in the diameter, ' | ||
'127.5 in last column except for the last row', | ||
() { | ||
final matrix = List.filled(defaultColorMatrix.length, 0.0); | ||
matrix[4] = 127.5; | ||
matrix[9] = 127.5; | ||
matrix[14] = 127.5; | ||
matrix[18] = 1; | ||
expect(ColorOption.contrast(0).matrix, matrix); | ||
}, | ||
); | ||
} |
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