| 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 + (b - a) * t; |
| 8 |
| 9 Color lerpColor(Color a, Color b, double t) { |
| 10 return new Color.fromARGB( |
| 11 lerpNum(a.alpha, b.alpha, t).toInt(), |
| 12 lerpNum(a.red, b.red, t).toInt(), |
| 13 lerpNum(a.green, b.green, t).toInt(), |
| 14 lerpNum(a.blue, b.blue, t).toInt()); |
| 15 } |
| 16 |
| 17 Offset lerpOffset(Offset a, Offset b, double t) { |
| 18 return new Offset(lerpNum(a.dx, b.dx, t), lerpNum(a.dy, b.dy, t)); |
| 19 } |
| OLD | NEW |