All Projects → noops-challenge → Hexbot

noops-challenge / Hexbot

Every request returns a different hex code—all 16,777,216 of them.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Hexbot

Prettyprint
Beautifully formatted output for your terminal 🌈
Stars: ✭ 195 (-22.31%)
Mutual labels:  color
Rainbow
🌈 Colorize commands output or STDIN using patterns.
Stars: ✭ 217 (-13.55%)
Mutual labels:  color
Color Space
Math & data behind color spaces and color conversions.
Stars: ✭ 232 (-7.57%)
Mutual labels:  color
Flutter statusbarcolor
A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.
Stars: ✭ 203 (-19.12%)
Mutual labels:  color
Contrast Swatch
🅰️ Image microservice for color contrast information
Stars: ✭ 210 (-16.33%)
Mutual labels:  color
Androidphotoshopcolorpicker
A fully featured Color picker Library for Android
Stars: ✭ 220 (-12.35%)
Mutual labels:  color
Color Picker
A simple color picker application written in pure JavaScript, for modern browsers.
Stars: ✭ 180 (-28.29%)
Mutual labels:  color
Nord Alacritty
An arctic, north-bluish clean and elegant Alacritty color scheme.
Stars: ✭ 238 (-5.18%)
Mutual labels:  color
Xcolor
Lightweight color picker for X11
Stars: ✭ 209 (-16.73%)
Mutual labels:  color
Sketch
Sketch have a lot of basic functions to develop a drawing app for iPhone. Anyone can easily create drawing iOS Application.
Stars: ✭ 229 (-8.76%)
Mutual labels:  color
Efcolorpicker
A lightweight color picker in Swift.
Stars: ✭ 205 (-18.33%)
Mutual labels:  color
Colors.lol
🎨 Overly descriptive color palettes
Stars: ✭ 207 (-17.53%)
Mutual labels:  color
Php Console Spinner
Colorful highly configurable spinner for php cli applications (suitable for async apps)
Stars: ✭ 225 (-10.36%)
Mutual labels:  color
Nord Terminal App
An arctic, north-bluish clean and elegant Terminal.app color theme.
Stars: ✭ 198 (-21.12%)
Mutual labels:  color
Spectra
A Javascript color library. Quickly manipulate and convert colors.
Stars: ✭ 235 (-6.37%)
Mutual labels:  color
Chartjs Plugin Colorschemes
Predefined color schemes for Chart.js
Stars: ✭ 189 (-24.7%)
Mutual labels:  color
Dynamic Support
A complete library to build Android apps with a built-in theme engine.
Stars: ✭ 218 (-13.15%)
Mutual labels:  color
Colorseekbar
A colorful SeekBar for picking color
Stars: ✭ 249 (-0.8%)
Mutual labels:  color
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (-5.18%)
Mutual labels:  color
Dynamiccolor
Yet another extension to manipulate colors easily in Swift and SwiftUI
Stars: ✭ 2,677 (+966.53%)
Mutual labels:  color

Hexbot

👋 Meet Hexbot

A different color with every ping.

Every request returns a different hex code. From #000000 to #FFFFFF—and all 16,777,216 colors between—you can do anything you want with the data.

Show the color? Sure.

Show the 80s movie poster with that hex as the dominant color? Better.

🖍 What can you do?

First, you can just request a color with a simple API request:

GET /hexbot

{
  "colors": [
    {"value": "#52a351"}
  ]
}

And then display it:

Job well done. We all have to start somewhere!

Now let's make it more interesting...

GET /hexbot?count=1000&width=500&height=500&seed=FF7F50,FFD700,FF8C00

Now we've added 1000 colors, each with coordinates, and seeded the colors with a range of hex codes. Then we've built up the frames over 100 iterations—much more interesting!

✨ A few ideas

Show the color: Display the color in a square. Hey, that's an accomplishment! It means you've successfully made an API request, handled the data, and did something with it. Not bad! For bonus points, add a way to refresh the API and change the color.

Randomize the colors: Request 1,000 colors and display them at random on screen, then every 5 seconds request another 1,000 colors and animate them to their next color.

Compare colors: A color is actually a very interesting data structure. It has a Red, Green, and Blue value, as well as luminosity and contrast. Given a hex code, can you determine whether a color is light or dark? Or what might pair well with it?

Pointillism: Make an homage to George Seurat, credited with creating Pointillism. Take a picture from the Unsplash API, break it up into smaller pieces, and rebuild it with random colors from the Hexbot. (Pass width and height to the API to get random coordinates with your data)

Search for the color: Use the color to load images from a search engine with color indexes (like DesignInspiration and Dribbble) and do something with the result.

Make a mood ring: Colors are often associated with different traits. Build a color sentiment engine, then evaluate how each color returned by the Hexbot should make you feel.

Name the colors: Paint color names are ridiculous (anything with "Greige" will do nicely), and a robot can come up with even better. You can use a neural net fed with thousands of paint names or make a Markov chain of pleasant, paint-y sounding names.

Why only colors? Who says a hex code has to be a color? Break it up into rgb and you have a 3D coordinate. Use those three points to play a tone, or provide the randomized physics in a game. Convert the value from hex to decimal, and now you have a number between 0 and 16,777,216 to play with.

Have an idea of your own? Create an issue and we'll add it to the list.

🤖 API basics

There's a single endpoint: api.noopschallenge.com/hexbot

The endpoint accepts four parameters, all optional:

  • count (optional, numeric): Between 1 and 1,000. Number of colors to return.
  • width (optional, numeric): Between 10 and 100,000. Maximum width of returned points.
  • height (optional, numeric): Between 10 and 100,000. Maximum height of returned points.
  • seed (optional, string): Comma separated list of hex codes, up to 10. Note that hex codes should not have the #. Returned colors will be a mix of a random combination of two of the seeds. If you submit an invalid hex code, you'll receive an error instead of more beautiful colors.

The endpoint returns a JSON object with an array named colors of n length.

Each item in the colors array is an object with the property value and, optionally, a coordinates object that has x and y properties.

Example return for five colors:

GET /hexbot?count=5

{
  "colors": [
    {"value": "#EF7FED"},
    {"value": "#5F47C2"},
    {"value": "#D5FF9F"},
    {"value": "#62B217"},
    {"value": "#DD36D9"}
  ]
}

Example return for five colors with coordinates:

GET /hexbot?count=5&width=1000&height=1000

{
  "colors":[
    {
      "value":"#2E84C5",
      "coordinates":{"x":755,"y":331}
    },
    {
      "value":"#116BAA",
      "coordinates":{"x":52,"y":998}
    },
    {
      "value":"#C742B2",
      "coordinates":{"x":617,"y":478}
    },
    {
      "value":"#4C2BB9",
      "coordinates":{"x":13,"y":183}
    },
    {
      "value":"#0C98FB",
      "coordinates":{"x":604,"y":507}
    }
  ]
}

Example of seeding colors with a comma delimited string of hex codes:

GET /hexbot?count=5&seed=FF7F50,FFD700,FF8C00

{
  "colors": [
    { "value": "#FF983A" },
    { "value": "#FF7F50" },
    { "value": "#FF7F50" },
    { "value": "#FFAB28" },
    { "value": "#FFBA1A" }
  ]
}

Complete API documentation.

Note to developers

The Hexbot is one of our simpler APIs, and you can easily generate random colors without accessing our API.

Here's the code we use to generate random hex codes (in JavaScript):

function randomHex() {
  const hexMax = 256 * 256 * 256;
  return '#' + Math.floor(Math.random() * hexMax).toString(16).toUpperCase().padStart(6, '0');
}

Implement that function in your code to generate millions of colors.

For manipulating colors, we're using Color, which allows you to change R, G, and B values and mix colors together. Give it a try! 🌈

Bonus: have you written your own implementation of a hex code generator? If you can do it in less than 256 characters, submit it in our Golfbot challenge.

More about Hexbot here: https://noopschallenge.com/challenges/hexbot

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].