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

Unified Diff: sky/engine/core/painting/Color.dart

Issue 1162023004: Update BoxDecoration and RenderParagraph to use sky.Color instead of int. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/examples/fn2/container.dart » ('j') | sky/examples/fn2/container.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Color.dart
diff --git a/sky/engine/core/painting/Color.dart b/sky/engine/core/painting/Color.dart
index b88e3b45619e84bac46be5ead6773ac2e3a20fcc..d487d0a444a3efa3a3db6b178b7a11bace94bf7a 100644
--- a/sky/engine/core/painting/Color.dart
+++ b/sky/engine/core/painting/Color.dart
@@ -8,6 +8,12 @@ class Color {
final int _value;
int get value => _value;
+ static const Color black = const Color(0xFF000000);
eseidel 2015/06/03 19:32:20 I wouldn't build these into colors, but rather on
Matt Perry 2015/06/03 20:17:01 Done.
+ static const Color white = const Color(0xFFFFFFFF);
+ static const Color red = const Color(0xFFFF0000);
+ static const Color green = const Color(0xFF00FF00);
+ static const Color blue = const Color(0xFF0000FF);
Hixie 2015/06/03 19:35:10 I don't think we should name colours. It's ok if t
Matt Perry 2015/06/03 20:17:01 Done.
+
const Color(this._value);
const Color.fromARGB(int a, int r, int g, int b) :
_value = (((a & 0xff) << 24) |
@@ -15,4 +21,12 @@ class Color {
((g & 0xff) << 8) |
((b & 0xff) << 0));
+ bool operator ==(other) {
+ if (!(other is Color)) return false;
+ return _value == other._value;
+ }
Hixie 2015/06/03 19:35:11 bool operator == (other) => other is Color && _val
Matt Perry 2015/06/03 20:17:01 Done.
+ int get hashCode {
+ return _value.hashCode;
+ }
Hixie 2015/06/03 19:35:11 int get hashCode => _value.hashCode;
Matt Perry 2015/06/03 20:17:01 Done.
+ String toString() => "Color($_value)";
kulakowski 2015/06/03 19:29:52 "Color(0x${_value.toRadixString(16)})" might be n
Hixie 2015/06/03 19:35:11 String toString() => "Color(0x${_value.toRadixStri
Matt Perry 2015/06/03 20:17:01 Awesome, thanks. Done. Are you OK with the Paint.
}
« no previous file with comments | « no previous file | sky/examples/fn2/container.dart » ('j') | sky/examples/fn2/container.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698