top | item 31673662

Hexwords: Hex colors that are similar to words

792 points| cialowicz | 3 years ago |hexwords.netlify.app

164 comments

order

karateka|3 years ago

I built something very similar a few years ago https://hex-colours.netlify.app/

gpt5|3 years ago

You mean identical? Seems like OP likely got inspired by your page :)

wodenokoto|3 years ago

Since yours hold a lot more uncommon words (by virtue of simply having many more words) a feature, if you are in the mood for updating, could be to sort by word frequency along with alphabetical sorting.

jy14898|3 years ago

Nice, hexwords only has 1000 words, compared to your 3500

hellohowareu|3 years ago

Feature idea for you and OP: add the visual swatch of color which the hex color represents. Makes it much more meaningful

dark-star|3 years ago

So which of these actually spell the color they represent (or something closely related)? From a quick glance, I have no found any. Do color-words like that exist in other languages maybe?

btown|3 years ago

#1C1E57 (ICIEST) is dark blue, which could hold true in certain contexts!

#DEBA65 (DEBAGS) is brown, much like de color of de bags made of de paper.

And on a related and exceptionally juvenile note, it should be very possible - and frankly obligatory, for those in fashion tech companies reading this - to create and sell a #B00B1E colored bra.

SamBam|3 years ago

#D0661E - a nice brown doggie.

#CA771E - brown cattle.

#C10ACA - a purple cloaca.

#C017A1 - coital, similarly purplish pink.

Lots of blues and greens starting with #5EA... (Sea...). #5EABED (Seabed), #5EABEE (Seabee), #5EAD06 (Seadog) and #5EA by itself.

(I used https://hex-colours.netlify.app/, which looks like it was the original from another comment, and allows you to search pieces of words.)

cecilpl2|3 years ago

#C0A575 (coasts) is a sandy-brown beach color.

#6E0DE5 (geodes) definitely has that deep purple color you think of.

And my favorite, #5A6E57 (sagest) is about as close to the color sage as you can get.

sisk|3 years ago

#B00B00 (dark red) was my favorite

mbil|3 years ago

Good question. I thought of an algorithm to find the hex word colors that most closely match the color they represent...

Basically: get the color of the _word_ by doing an image search and extracting the dominant color from the first image result. Then compare that color to the hex color (in CIELAB color space) to get the color difference. Track the hex words with lowest difference.

Here's a rough impl in Python:

  import sys
  import os
  import heapq
  
  import requests
  from google.cloud import vision
  
  from colormath.color_objects import sRGBColor, LabColor
  from colormath.color_conversions import convert_color
  from colormath.color_diff import delta_e_cie2000
  
  from bs4 import BeautifulSoup
  
  def download_image_for_query(query):
      search_key = os.getenv("GOOGLE_CUSTOM_SEARCH_ENGINE_KEY")
      search_engine_id = os.getenv("GOOGLE_CUSTOM_SEARCH_ENGINE_ID")
      resp = requests.get(
          f"https://www.googleapis.com/customsearch/v1?key={search_key}&cx={search_engine_id}&q={query}&searchType=image"
      )
      img_url = resp.json()["items"][0]["link"]
      img_content = requests.get(img_url).content
      return img_content
  
  def dominant_rgb_colors(image_content, num_colors=1):
      vision_client = vision.ImageAnnotatorClient()
      image = vision.Image(content=image_content)
      response = vision_client.annotate_image({"image": image})
      return [
          (int(c.color.red), int(c.color.green), int(c.color.blue))
          for c in response.image_properties_annotation.dominant_colors.colors
      ][:num_colors]
  
  # class to store hex word and calculate the difference from "true" image, based on image search
  class HeapibleHexWord:
      def generate_rgb_version(self):
          return tuple(int(self.hex_version.lstrip("#")[i:i+2], 16) for i in (0, 2, 4))
          
      def __init__(self, hex_version, english_version):
          self.hex_version = hex_version
          self.english_version = english_version
          self.rgb_version = self.generate_rgb_version()
          self.delta_from_true = float("inf")
          
      def calculate_delta_from_true(self):
          true_rgb = sRGBColor(*self.rgb_version)
          query = self.english_version
          img_content = download_image_for_query(query)
          test_rgb = sRGBColor(*dominant_rgb_colors(img_content)[0])
         
          # via http://hanzratech.in/2015/01/16/color-difference-between-2-colors-using-python.html
          delta = delta_e_cie2000(
              convert_color(true_rgb, LabColor),
              convert_color(test_rgb, LabColor)
          )
          self.delta_from_true = delta
          
      def __lt__(self, other):
          return self.delta_from_true < other.delta_from_true
  
  # scrape words from hexwords site
  hexwords_url = 'https://hexwords.netlify.app/'
  
  hexwords_page = requests.get(hexwords_url)
  soup = BeautifulSoup(hexwords_page.text, 'html.parser')
  
  buttons = soup.find_all('button', class_='svelte-1m9ptdb')
  
  hex_words = []
  for button in buttons:
      if button.text == '':
          continue
      hex_version, _, english_version = button.text.split("\n")
      hex_words.append((hex_version, english_version.replace("(", "").replace(")", "")))
  
  # iterate over the hex words, calculating the color diff between the word's hex
  # color and the "true" color based on image search
  
  hex_words_heap = []
  heapq.heapify(hex_words_heap)
  
  NUM_WORDS = 10 # looks like throttled at some point
  
  for i, hex_word in enumerate(hex_words[:NUM_WORDS]):
      print(f"working on {i}: {hex_word}")
      heapible_hex_word = HeapibleHexWord(*hex_word)
      heapible_hex_word.calculate_delta_from_true()
      heapq.heappush(hex_words_heap, heapible_hex_word)
  
  # popping from the min heap yields hexwords with smallers difference from true color
  heapq.heappop(hex_words_heap).english_version

magneticnorth|3 years ago

A couple more I spotted:

#ACAC1A is a shade of green and Acacia is a type of tree.

#57061E (stogie) is dark brown, and a stogie is a cigar.

failTide|3 years ago

#CABB1E is kind of like a taxicab yellow

kbd|3 years ago

#A55E55 (asses) is brown. Oh... wait.

myrmidon|3 years ago

#AC1D1C is red, just like its PH test- that was the most satisfying one to me at first glance.

stingrae|3 years ago

maybe #5EABED, which is a shade of blue?

bee_rider|3 years ago

Kind of a stretch, but #B05535 (bosses) and #BE57ED (bested) are both sort of purplish colors that looter games like Borderlands sometimes use for "pretty rare, but not unique" items (which would typically be dropped by a boss monsters when you defeat them).

swid|3 years ago

How many colors do you typically identify or would be willing to accept? Somewhere between 10 and 25 would be sufficient… not every word will have a color association, but many will have more than one.

I think you need to be pretty strict to not find a match after 50 words.

wwilim|3 years ago

#ACCE55 is green and #F1A5C0 is pinkish red, great colors for a login prompt

jsf01|3 years ago

5EABED (a blue) and B00B00 (blood red) were the best matches I found

davchana|3 years ago

Similar things in a number's value v/s its number of characters I think is called True Number, & only 4 is a true number like 4 value & FOUR has exact 4 letters.

madcaptenor|3 years ago

My children definitely have clothes in colors close to #BAB1E5. #B00B00 kind of looks like blood.

donpott|3 years ago

A bit of a stretch, but I remarked upon #ACE71C (acetic), which is an oily, vinegary green

rhplus|3 years ago

SEABED - blue CASSIS - purplish pink berry color

pdpi|3 years ago

Hexspeak[0] is a time-honoured tradition, with constants like 0xDEADBEEF used to mark uninitialised memory. Fun to see it applied to colours.

0. https://en.wikipedia.org/wiki/Hexspeak

collegeburner|3 years ago

Yeah B16B00B5 and CAFEBABE are 2 of my favorite funnier ones Ive used a bunch of times. They make for more interesting placeholder values than "foo" and "bar" anyway.

jerrysievert|3 years ago

I remember seeing 0xdeadbeef for the first time in dbx, which was my first experience with seeing uninitialized memory - was really surprised to not see it in the list on the website, since it's rgb+o (red/green/blue + opacity).

kretaceous|3 years ago

I've always wanted to make something like this! This is awesome. Filters to weed out leetspeak words, use only letters/numbers, etc would be great.

It was on my "toy project list" after reading these two very interesting stories/threads:

The famous CAFEBABE story: https://stackoverflow.com/questions/2808646/why-are-the-firs...

Why does HTML think “chucknorris” is a color?: https://stackoverflow.com/questions/8318911/why-does-html-th...

gunnarmorling|3 years ago

Disappointed to see that C#'s counterpart to Java's 0xCAFEBABE is missing: 0xBADDECAF /s

c22|3 years ago

I'm gonna start using #ACCE55 to indicate successful login and #B00B00 on failure.

distrill|3 years ago

wow. they're ugly, but that's awesome they map to green and red.

amelius|3 years ago

7->T and 6->G is pushing it too far, imho.

BaraBatman|3 years ago

Isn't LEET === 1337 pretty standard?

yellowapple|3 years ago

But then how am I supposed to turn a slur like #FA6607 into a nice (might I say fruity) shade of orange?

warning26|3 years ago

I'd like to have filters to play with different levels of substitution. Only alpha, only 3 -> e, etc.

googlryas|3 years ago

2->Z as well. I've been a h4x0r for 25+ years and "21663D" looks nothing like "zigged" to me.

spencerchubb|3 years ago

i agree, 9 would be better suited as G

mikece|3 years ago

Where has this been all of my career? Very #BADA55 indeed!

rommel917|3 years ago

#BADA55 is skin color of kerbals from KSP

gtm1260|3 years ago

Ya'll are missing my favorite one, although I guess its technically two words. "Dad CEO": #dadce0

nr2x|3 years ago

This should be turned into some hybrid between Wordle and MDN.

turtledove|3 years ago

Found a slur in the dataset, not sure if these are programmatically generated (I assume so) but may want to consider filtering those out.

Veen|3 years ago

It's worth pointing out that they are slurs in the U.S., not globally. One is a type of meatball where I'm from.

joshuahaglund|3 years ago

For the curious, I think they mean decimal values 16408693 and 16410119. Which have other archaic meanings but their primary modern meanings are a slur. 16410349 is apparently British slang for exhausted, so maybe gets a pass?

CobrastanJorji|3 years ago

#5A6E57, SAGEST, is interesting because it appears to be the most sage-like color on the board and is therefore autological.

zem|3 years ago

in my last job we used to work #C0FFEE coloured elements into our UI as a little easter egg of sorts.

abathur|3 years ago

This is dumb, and I am in love with it. I'll have to use some of these... :)

xigoi|3 years ago

I have a project named “xidoc”. I spent a long time trying to come up with a logo and a primary color, then I got the cute idea of using the letter ξ (xi) in the color #d0c (which happens to be a quite lovely magenta).

andrewbaron|3 years ago

From 2014 http://bada55.io/ includes a much more expansive set considering hex colors do not require all six characters. #101

andix|3 years ago

You can do the same with ipv6 addresses. Something like dead:beef::babe

thenoblesunfish|3 years ago

Would be fun to plot all these on a color wheel to see how non-uniform it is, as a consequence of the distribution in English words (which can be represented this way).

langsoul-com|3 years ago

Reminds me about when people had to generate a string of random characters but take anything out that's close to a slur.

Forgot what the end result was, no vowels and numbers?

IntrepidWorm|3 years ago

Yeah, it's a prime example of a sisyphean task. Language is too varied and fluid, and the internet is far too juvenile to be censored for any length of time (not a dig, but you try telling reddit they can't say slurs anymore).

fjfaase|3 years ago

My initial and surname when written as an hexcode make a nice orange colour: Texas rose, according to some website.

Are there more people that can write their name as a hexcode?

phabricator|3 years ago

Thanks for making an interesting article and only plugging your site at the end. I don't mind submarine ads if I can learn something from them.

sigil|3 years ago

Really disappointed #dadb0d didn't make the cut.

danielvaughn|3 years ago

Whenever I give a demo, I always use #BADA55 because I have the maturity of a 12 year old. This will definitely expand my repertoire.

loudthing|3 years ago

This is simultaneously interesting and useless.

paradite|3 years ago

I use d3 for visualization, and my favourite default color for everything is #d3d3d3. Works well in a lot of situations.

tunesmith|3 years ago

I love that "booboo" is blood red.

soheil|3 years ago

I wonder if there is another base other than 16 that would generate the most beautiful colors with most words.

tonicbbleking|3 years ago

To me, #CA551A wins it. Looks a lot like cassia tree bark, aka cinnamon.

apricot|3 years ago

I like that AC1D1C is red but BA51C is green. Hex code litmus paper.

jalk|3 years ago

Love it. Now I need some nice looking/sounding palette phrases :-)

ljoshua|3 years ago

#B00B00 is one of my favorites as a dad with young kids (it’s red). :)

phelm|3 years ago

Didn't someone once set the PETA website to #BEEEEF

bezoz|3 years ago

This would make a pretty cool MIT Mystery Hunt puzzle!

oniony|3 years ago

I really don't like this colour: #DE7E57

hajimuz|3 years ago

Badass color is not bad ass at all… :)

thrdbndndn|3 years ago

What does "alpha" switch do?

itcrowd|3 years ago

Includes longer words to define the alpha (transparency) channnel

uwagar|3 years ago

is it just for me? the copy icon seems on top of every word obstructing the view... :(

gloryless|3 years ago

This is amazing, love it!!

nathias|3 years ago

pretty cool, now we need something like a prettier plugin that forces hexes to the nearest hexword to make it useful

jjslocum3|3 years ago

What a fun and fantastic mnemonic tool!

kwatsonafter|3 years ago

This is the kind of quirky, brilliant link I crave from Hacker News. If I was near you creator, I would garland you and rub your feet.

lucasyvas|3 years ago

Second sentence escalated quickly.

helsinki|3 years ago

[deleted]

dmead|3 years ago

[deleted]

curling_grad|3 years ago

The hacker news orange is #ff6600. Pretty close.

reidjs|3 years ago

[deleted]

superb-owl|3 years ago

You many want to consider a naughty words filter. https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and...

warning26|3 years ago

Since the raison d'être of this project seems to be spelling ridiculous things out of hex colors, I think it would lose a lot of its appeal with such a filter.

failTide|3 years ago

I understand a lot of those, but why is "beaver cleaver" on the list? I could see how it might be used in a dirty way, but that can't be the most common way it's used, right?

samb1729|3 years ago

Or better yet, they could ignore this suggestion entirely!