cool.
jrs
On Mar 10, 2006, at 7:35 PM, Max Carlson wrote:
> Change 40453 by [EMAIL PROTECTED] on 2006/03/10 16:30:07 *pending*
>
> Summary:
>
> New Features: Add support for css color strings in drawview
>
> Bugs Fixed:
>
> Technical Reviewer: Jim
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
>
> Details:
>
> Tests:
>
> Affected files ...
>
> ... //depot/lps-dev/WEB-INF/lps/lfc/views/LzDrawView.as#17 edit
> ... //depot/lps-dev/test/drawing/drawing.lzx#4 edit
>
>
> Differences ...
>
> ==== //depot/lps-dev/WEB-INF/lps/lfc/views/LzDrawView.as#17 -
> c:\Laszlo\lps-dev\
> WEB-INF\lps\lfc\views\LzDrawView.as ====
> 123a124
> > var savedStyle = this.fillStyle;
> 131a133
> > this.fillStyle = this.cssColorToLong(this.fillStyle);
> 138a141
> > this.fillStyle = savedStyle;
> 155a159
> > var savedStyle = this.strokeStyle;
> 157c161
> < //_root.Debug.warn ("Gradient line fills aren't supported.");
> ---
> > _root.Debug.warn ("Gradient line fills aren't supported.");
> 159a164
> > this.strokeStyle = this.cssColorToLong(this.strokeStyle);
> 165a171
> > this.strokeStyle = savedStyle;
> 520c526
> < this._c[this._c.length] = c;
> ---
> > this._c[this._c.length] = LzDrawView.prototype.cssColorToLong(c);
> 530a537,558
> >
> > // Convert a css color string to an integer. This recognizes only
> > // '#rgb', '#rrggbb', and the color names that have been defined in
> > // the global namespace ('red', 'green', 'blue', etc.)
> > LzDrawView.prototype.cssColorToLong = function(value) {
> > if (typeof value != 'string') return value;
> > if (value.charAt(0) == '#') {
> > var n = parseInt(value.slice(1), 16);
> > switch (!isNaN(n) && value.length-1) {
> > case 3:
> > return ((n & 0xf00) << 8 | (n & 0xf0) << 4 | (n & 0xf))
> * 17;
> > case 6:
> > return n;
> > default:
> > Debug.warn('invalid color: ' + value);
> > }
> > }
> > if (typeof eval(value) == 'number')
> > return eval(value);
> > Debug.warn('unknown color format: ' + value);
> > return 0;
> > }
> ==== //depot/lps-dev/test/drawing/drawing.lzx#4 -
> c:\Laszlo\lps-dev\test\drawing
> \drawing.lzx ====
> 11c11
> < this.fillStyle = 0x0000ff;
> ---
> > this.fillStyle = '#0000ff';
> 15c15
> < this.strokeStyle = 0xffff00;
> ---
> > this.strokeStyle = '#ffff00';
> 23c23
> < g.addColorStop(1, 0xffffff);
> ---
> > g.addColorStop(1, '#ffffff');
> <changeset-40453.zip>_______________________________________________
> Laszlo-dev mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev