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
|

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.


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

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

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

Philippe Marschall
http://code.google.com/p/seaside/issues/detail?id=88

2008/7/4, Boris Popov <[hidden email]>:

> 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.
>
>
> _______________________________________________
>  seaside mailing list
>  [hidden email]
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside