nowfound

Life & fun · April 15, 2016

Draw a map and let it be colored – Four color theorem demo

Draw a map and let it be colored – Four color theorem demo launched on April 15, 2016 with 48 votes, #1,655 of 4,301 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 10 years on.

In plain words

This interactive tool lets users draw lines on a canvas to create map regions, then applies an automated coloring algorithm based on the four color theorem. After drawing, users click solve and the application colors adjacent regions with different colors, using backtracking techniques to find valid solutions within a 10-second limit. Built with ProcessingJS, it demonstrates graph coloring principles through a hands-on drawing interface.

written from the facts on this page · September 2026

From the sources

Draw lines on the canvas and after you've finished, click solve to color the map. Note: Backtracking may take some time and may not always find a solution in time (10s max). The coloring and canvas handling is powered by ProcessingJS . The steps for solving a graph are the following: It's necessary to have clear borders for finding distinct areas, and also for the examination of neighbor. As you can see, the line is a bit thicker so they are clearly visible and also we can avoid some nasty 1-pixel-diagonal problems. Finding the neighbors is the hard part. Generally, if two areas have some pixels which lie near enough beside each other, they can be considered neighbors. Now it doesn't make…from kleemans.ch

Does a similar job

all alternatives →
  • Simple algorithm and color space to generate diverse skin tonesAug 2026 · toneyalexander.github.io · ▲627

    Hello HN! I found that picking out plausible but diverse skin tones for my digital art and game development projects was kind of difficult, and I got curious about if there was a way to define a color space that made it easy. I've built a color picker and procedural generation algorithm based on the space as well as a bunch of other fun js features and demos throughout the page that use the equations. If you find it interesting, I have lots of explanations of how I built it and what properties the space has. The methodology might be a bit shaky, but hopefully the result is as helpful for…

  • AC
    A coloring book of data structures and algorithms2017 · ▲523

    I'm making a coloring book of data structures and algorithms for programmers and students. So far I have a prototype page for a sorting algorithm (albeit a rather simple one). Here the Selection Sort coloring pages you can print. https://coderscoloringbook.com/selectionsort And here is how I colored mine. https://coderscoloringbook.com/selectionsortcolored A coloring book is not quite enough to teach algorithms on its own, but I really get a lot from visual reinforcement of what I learn from books/lectures. Do you think having coloring pages like this could…

  • Chain2017 · lalomrtnz.github.io · ▲220

    Create dynamic color relations in Sketch.

  • AL
  • Color Brewer2015 · colorbrewer2.org · ▲63

    Color Palettes for Cartography

  • ColorSpark for Sketch2018 · ▲133

    Discover unique colors and gradients directly in Sketch.

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, April 2016

the whole month →
  • Email copy from great companies.

    Growth · 2016 · goodemailcopy.com

  • The mass market electric car by Tesla is here ⚡️🚘

    Life & fun · 2016 · tesla.com

  • Kite▲867

    Internet-connected programming

    Dev tools · 2016 · kite.com

  • Access all the files on Dropbox without having to sync

    Work · 2016 · blog.dropbox.com

  • The easiest way to build an FB bot. No coding required!

    Dev tools · 2016

  • Quickly find your Bootstrap classes on this interactive Bootstrap cheat sheet. It includes code samples and live preview of elements.

    Dev tools · 2016 · hackerthemes.com