Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 * (1.0 - t) + b * 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()); | |
| 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)); | |
|
abarth-chromium
2015/06/30 22:26:09
Should these functions be on Color and Offset, res
Matt Perry
2015/07/01 18:17:43
Yeah I dunno.. lerp doesn't feel important enough
| |
| OLD | NEW |