Skip to the content

Low Code Life

Hacking away unnecessary LOCs since 1980.



Generating unique, contrasting colors in JavaScript

Author: smeans
Date: 2021-02-14
Tags: BitTwiddling, CSS, JavaScript
Categories: Useful Code

Coming up with contrasting, attractive colors for an unknown number of items can be tricky. This post gives a short (10 line) function that returns unique colors for an arbitrary number of items using bit manipulation.


Recent Comments

    Archives

    • June 2022
    • March 2022
    • February 2022
    • January 2022
    • August 2021
    • July 2021
    • May 2021
    • February 2021
    • January 2021

    Categories

    • Beautiful Code
    • Code
    • FOSS
    • Fun Code
    • Software Development
    • Useful Code
    • Website

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    © 2023 Low Code Life. All rights reserved. Powered by WordPress.