OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Utility library for creating web colors. | 5 /// Utility library for creating web colors. |
6 | 6 |
7 library colors; | 7 library sourcemaps.colors; |
8 | 8 |
9 /// A web color. | 9 /// A web color. |
10 abstract class Color { | 10 abstract class Color { |
11 /// The css code for the color. | 11 /// The css code for the color. |
12 String get toCss; | 12 String get toCss; |
13 } | 13 } |
14 | 14 |
15 /// A web color defined as RGB. | 15 /// A web color defined as RGB. |
16 class RGB implements Color { | 16 class RGB implements Color { |
17 final double r; | 17 final double r; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return new RGB(p, q, v); | 112 return new RGB(p, q, v); |
113 case 4: | 113 case 4: |
114 return new RGB(t, p, v); | 114 return new RGB(t, p, v); |
115 default: // case 5: | 115 default: // case 5: |
116 return new RGB(v, p, q); | 116 return new RGB(v, p, q); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 String toString() => 'hsv($h,$s,$v)'; | 120 String toString() => 'hsv($h,$s,$v)'; |
121 } | 121 } |
OLD | NEW |