hello there,<br><br>i don't know it the problem is still known but the following i figured yesterday:<br><br>when using the class method <br>Color&gt;&gt;fromString: 'yellow'<br><br>or also<br>Color&gt;&gt;fromString: 'orange'
<br><br>you will always get the hex-value of black. so i figured the following mistake<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
aString first = $#<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ifTrue: [aColorHex := aString copyFrom: 2 to: aString size]<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ifFalse: [aColorHex := aString].<br>&nbsp;&nbsp; &nbsp;[aColorHex size = 6<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ifTrue:<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [aColorHex := aColorHex asUppercase.
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; red := ('16r', (aColorHex copyFrom: 1 to: 2)) asNumber/255.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; green := ('16r', (aColorHex copyFrom: 3 to: 4)) asNumber/255.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blue := ('16r', (aColorHex copyFrom: 5 to: 6)) asNumber/255.
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ^ self r: red g: green b: blue]]</blockquote><div><br>u see: aColorHex will be aString when there is no '#' within the string. but when the string has just the size of 6 (like it is given with 'yellow' or 'orange' then the statement will also be true. in fact of that you get a wrong hex for the right color :)
<br><br>i just tried the following<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">aString first = $#<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: [aColorHex := (aString copyFrom: 2 to: aString size) asNumber]
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [aColorHex := aString].<br>&nbsp;&nbsp;&nbsp; [(aColorHex isNumber)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [aColorHex := aColorHex asUppercase.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; red := ('16r', (aColorHex copyFrom: 1 to: 2)) asNumber/255.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; green := ('16r', (aColorHex copyFrom: 3 to: 4)) asNumber/255.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; blue := ('16r', (aColorHex copyFrom: 5 to: 6)) asNumber/255.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ^ self r: red g: green b: blue]]</blockquote><div><br>but in fact i couldn't test it very deeply i don't know if it still serves well when using hex-colors higher then 10 (
e.g. A1 or FF)<br>there is also the problem that asHex is deprecated - so i can't use it instead.<br><br>thx for your patience :)<br></div><br>&nbsp;</div><br>