Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Converting hex colors to color safe hex

by radiantmatrix (Parson)
on Apr 11, 2008 at 16:22 UTC ( #679741=note: print w/replies, xml ) Need Help??


in reply to Converting hex colors to color safe hex

Do you perhaps mean "web safe" instead of "color safe"? If so, it's a pretty easy approach.

Each element of the color is 1 byte (0-255 unsigned), and expressed in hex. All you have to do is round the values of each byte to the nearest in the "web safe" color chart. (with some bounds-checking, of course).

Show us some code on what you've tried, perhaps trying to implement that kind of solution, and you'll get better help. Check out How (Not) To Ask A Question for tips on getting the best help here.

<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet
  • Comment on Re: Converting hex colors to color safe hex

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://679741]
help
Chatterbox?
[MidLifeXis]: (5.22 at that time)
[MidLifeXis]: Yeah, I know, really helpful :-)
[Corion]: If all else fails, Spreadsheet::XLSX should be "installable" by manually copying the files, provided that the prerequisites are met
[thezip]: It fails in the "formatted 2-digit numeric" tests
[thezip]: Okay Corion, that's what I wanted to hear. Thanks!
[Corion]: Oh, a test failure... Just force-install it then? --force and potentially --notest to skip the tests alltogether ?
[ambrus]: thezip: is Activestate Perl usable for your scenario instead?
[MidLifeXis]: Yeah, --notest is good, not sure I would do --force.
[thezip]: It fails 2/10 tests in that group. What are the ramifications if I force it? What should I look for for?
[thezip]: I've migrated from ActiveState to Strawberry. No going back...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2017-03-23 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (290 votes). Check out past polls.