Skip to main content
formatting, and removing extraneous info
Source Link
Darragh Enright
  • 14k
  • 8
  • 44
  • 49

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000#000000 and #FFFFFF#FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (i.e.g: #FFF#FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (i.e: #FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (e.g: #FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

deleted 216 characters in body; edited tags; edited title
Source Link
Rob W
  • 346.6k
  • 85
  • 804
  • 681

Create a hexadecimal colour based on a string with jQuery/JavaScript.JavaScript

Sorry if this is a vague question... I'm not really sure how to go about it so maybe someone with the wisdom can point me in the right direction :)

Basically, I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (i.e: #FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.

Thanks and much appreciation in advance :) Darragh

Create a hexadecimal colour based on a string with jQuery/JavaScript.

Sorry if this is a vague question... I'm not really sure how to go about it so maybe someone with the wisdom can point me in the right direction :)

Basically, I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (i.e: #FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.

Thanks and much appreciation in advance :) Darragh

Create a hexadecimal colour based on a string with JavaScript

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour for a HTML element.

Maybe even a shorthand hex value (i.e: #FFF) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.

I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.

spelling correction.; edited title
Link
Darragh Enright
  • 14k
  • 8
  • 44
  • 49

Create a hexidecimalhexadecimal colour based on a string with jQuery/JavaScript.

Source Link
Darragh Enright
  • 14k
  • 8
  • 44
  • 49
Loading