Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Side by Side Diff: sky/sdk/lib/base/lerp.dart

Issue 1211603003: Baby steps towards an odeon-like animation system. First victim: Drawer. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: abarth and hixie Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 import 'dart:sky';
6
7 num lerpNum(num a, num b, double t) => a + (b - a) * t;
8
9 Color lerpColor(Color a, Color b, double t) =>
10 new Color.fromARGB(lerpNum(a.alpha, b.alpha, t).toInt(),
11 lerpNum(a.red, b.red, t).toInt(),
12 lerpNum(a.green, b.green, t).toInt(),
13 lerpNum(a.blue, b.blue, t).toInt());
abarth-chromium 2015/07/01 19:44:08 We've been using { } rather than => when the body
Matt Perry 2015/07/01 20:05:40 Done.
14
15 Offset lerpOffset(Offset a, Offset b, double t) =>
16 new Offset(lerpNum(a.dx, b.dx, t),
17 lerpNum(a.dy, b.dy, t));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698