Welcome Guest, Not a member yet? Register   Sign In
Where to put this 3rd party PHP package?
#10

[eluser]mhulse[/eluser]
[quote author="Mikeemoo" date="1287617715"]Hi,

Just convert it to a Hex, then use toString() to get it as a string representation.

...<snip>...

Every color format has a "to" method that will convert to any other color format.[/quote]

WOW, that is sooooo cool! Thanks so much for the examples, that will really help me get the ball rolling.

I had not used the toString() method yet... I had been iterating through the returned array. For example:

Code:
&lt;?php
//...
$black = new Hex(0x000000);
$blue = new Hex(0x2491B5);
$range2 = $blue->range($black, 10, TRUE);
//...
?&gt;

&lt;?php foreach ($range2 as $key => $val): ?&gt;
    
    <div style="width:50px;height:50px;float:left;display:inline;background-color:rgb(&lt;?=$val->toRGB()->r?&gt;, &lt;?=$val->toRGB()->g?&gt;, &lt;?=$val->toRGB()->b?&gt;)"></div>
    
&lt;?php endforeach; ?&gt;

Well, the above works great, but it looks like the toString() method could save me some work. Smile

I love this code!!!!!

Thanks so much Mike! I really appreciate it. Smile


Messages In This Thread
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 02:20 AM
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 03:39 AM
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 03:42 AM
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 04:01 AM
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 10:36 AM
Where to put this 3rd party PHP package? - by El Forum - 10-19-2010, 10:29 PM
Where to put this 3rd party PHP package? - by El Forum - 10-20-2010, 03:07 AM
Where to put this 3rd party PHP package? - by El Forum - 10-20-2010, 11:08 AM
Where to put this 3rd party PHP package? - by El Forum - 10-20-2010, 12:35 PM
Where to put this 3rd party PHP package? - by El Forum - 10-20-2010, 12:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB