Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ab2b7918
Commit
ab2b7918
authored
Jul 24, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimizes ColorSequence
parent
2e2331ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
color_secuence.dart
packages/flutter/example/game/lib/color_secuence.dart
+4
-6
No files found.
packages/flutter/example/game/lib/color_secuence.dart
View file @
ab2b7918
...
...
@@ -24,13 +24,11 @@ class ColorSequence {
colors
=
new
List
<
Color
>();
colorStops
=
new
List
<
double
>.
from
(
sequence
.
colorStops
);
math
.
Random
rand
=
new
math
.
Random
();
for
(
Color
color
in
sequence
.
colors
)
{
int
aDelta
=
((
rand
.
next
Double
()
*
2.0
-
1.0
)
*
alphaVar
).
toInt
();
int
rDelta
=
((
rand
.
next
Double
()
*
2.0
-
1.0
)
*
redVar
).
toInt
();
int
gDelta
=
((
rand
.
next
Double
()
*
2.0
-
1.0
)
*
greenVar
).
toInt
();
int
bDelta
=
((
rand
.
next
Double
()
*
2.0
-
1.0
)
*
blueVar
).
toInt
();
int
aDelta
=
((
rand
om
Double
()
*
2.0
-
1.0
)
*
alphaVar
).
toInt
();
int
rDelta
=
((
rand
om
Double
()
*
2.0
-
1.0
)
*
redVar
).
toInt
();
int
gDelta
=
((
rand
om
Double
()
*
2.0
-
1.0
)
*
greenVar
).
toInt
();
int
bDelta
=
((
rand
om
Double
()
*
2.0
-
1.0
)
*
blueVar
).
toInt
();
int
aNew
=
(
color
.
alpha
+
aDelta
).
clamp
(
0
,
255
);
int
rNew
=
(
color
.
red
+
rDelta
).
clamp
(
0
,
255
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment