Jump to content

Sorting Hex Colors


mister5317

Recommended Posts

I have an array of hexadecimal color codes:

 

Array
(
    [0] => 2060A0
    [1] => 204080
    [2] => 206080
    [3] => 000000
    [4] => A0A0A0
    [5] => C0C0C0
    [6] => 808080
    [7] => E0E0E0
    [8] => 404040
    [9] => 80A0A0
    [10] => 202020
    [11] => 002020
)

 

I would like to sort the array by color.  I tried a natsort() and that didn't work the way I would have liked.

Does anyone have any ideas on how to accomplish this?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/150772-sorting-hex-colors/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.