[vwnc] Updated ColorValue>>fromString: to support 3-digit notation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Updated ColorValue>>fromString: to support 3-digit notation

Boris Popov, DeepCove Labs (SNN)
I had just updated fromString method to support three-digit notation and
pass the following test case, was thinking it might be useful to
someone, but again, can't quite say if this is something Cincom folks
need to integrate in their branch of Squeak-Extensions or something that
should go into Squeak's version, so don't jump on my case for
cross-posting please ;)

testColorFromString
       
 self assert: (ColorValue fromString: 'ff0000') = ColorValue red.
 self assert: (ColorValue fromString: 'FF0000') = ColorValue red.
 self assert: (ColorValue fromString: '#ff0000') = ColorValue red.
 self assert: (ColorValue fromString: '#FF0000') = ColorValue red.
 self assert: (ColorValue fromString: 'f00') = ColorValue red.
 self assert: (ColorValue fromString: 'F00') = ColorValue red.
 self assert: (ColorValue fromString: '#f00') = ColorValue red.
 self assert: (ColorValue fromString: '#F00') = ColorValue red.
 self assert: (ColorValue fromString: 'red') = ColorValue red.
 self assert: (ColorValue fromString: 'RED') = ColorValue red.
 self assert: (ColorValue fromString: '#red') = ColorValue red.
 self assert: (ColorValue fromString: '#RED') = ColorValue red.

Cheers,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

ColorValue class-fromString.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Updated ColorValue>>fromString: to support 3-digit notation

Andres Valloud-6
AR 54731, thank you!

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Boris Popov
Sent: Friday, July 04, 2008 12:13 PM
To: [hidden email]; Seaside - general discussion
Subject: [vwnc] Updated ColorValue>>fromString: to support 3-digit
notation

I had just updated fromString method to support three-digit notation and
pass the following test case, was thinking it might be useful to
someone, but again, can't quite say if this is something Cincom folks
need to integrate in their branch of Squeak-Extensions or something that
should go into Squeak's version, so don't jump on my case for
cross-posting please ;)

testColorFromString
       
 self assert: (ColorValue fromString: 'ff0000') = ColorValue red.
 self assert: (ColorValue fromString: 'FF0000') = ColorValue red.
 self assert: (ColorValue fromString: '#ff0000') = ColorValue red.
 self assert: (ColorValue fromString: '#FF0000') = ColorValue red.
 self assert: (ColorValue fromString: 'f00') = ColorValue red.
 self assert: (ColorValue fromString: 'F00') = ColorValue red.
 self assert: (ColorValue fromString: '#f00') = ColorValue red.
 self assert: (ColorValue fromString: '#F00') = ColorValue red.
 self assert: (ColorValue fromString: 'red') = ColorValue red.
 self assert: (ColorValue fromString: 'RED') = ColorValue red.
 self assert: (ColorValue fromString: '#red') = ColorValue red.
 self assert: (ColorValue fromString: '#RED') = ColorValue red.

Cheers,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc