-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Right-align frame time, and use color objects.
Also adds color object from viewer branch.
- Loading branch information
Showing
2 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*global define*/ | ||
define(function() { | ||
"use strict"; | ||
|
||
/** | ||
* A color, specified using red, green, blue, and alpha values, | ||
* which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity). | ||
* | ||
* @constructor | ||
* @name Color | ||
*/ | ||
function Color(red, green, blue, alpha) { | ||
this.red = red; | ||
this.green = green; | ||
this.blue = blue; | ||
this.alpha = alpha; | ||
} | ||
|
||
/** | ||
* Returns a string containing a CSS color value for this color. | ||
*/ | ||
Color.prototype.toCSSColor = function() { | ||
var r = this.red * 255 | 0; | ||
var g = this.green * 255 | 0; | ||
var b = this.blue * 255 | 0; | ||
return 'rgba(' + r + ',' + g + ',' + b + ',' + this.alpha + ')'; | ||
}; | ||
|
||
return Color; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters