Dynamically Adjusting Image Text for Contrast

Yesterday I was pleasantly surprised to discover that one of my favorite JavaScript libraries, Color Thief, had gotten a major update. Color Thief examines an image and can tell you the dominant color as well as the five most used colors. I thought this was pretty cool, and over the past, I kid you not, 14 years, I’ve blogged about it a few times: Demo of Color Palettes and PhoneGap – from way back in 2012 Capturing camera/picture data without PhoneGap – in 2013 Drag and drop image matching search at Behance – do people still use Behance? New Camera Hotness from Chrome – "new" as of 2017 Building a Progressive Color Thief – this was me exploring... more →
Posted in: JavaScript

Dynamically Showing and Hiding Markers in Leaflet

This was originally going to be an example of using Leaflet with Alpine.js, but while working on that demo I discovered an interesting aspect of Leaflet that was a bit more difficult than I thought it would be – hiding and showing markers. Here’s how I approached the problem, and as always, if you know of a better way, leave me a comment below and share! Approach One For my first demo, I decided to start simple. First, I built a function to return a static set of data: async function getStores() { return new Promise(resolve => { let stores = [ { name: "Lafayette Store", open24Hours:true, location: { lat:30.216, lng: -92.033 }}, { name: "Baton Rouge Store",... more →
Posted in: JavaScript

Dynamically Creating Variables in Postman

This may come as a shock to you, but sometimes, I don’t read the documentation for the tools I use. Sometimes, I don’t even look at all the various menu items and UI stuff for the tools I use. I know I’m probably the only one who does that and I apologize for letting down my faithful readers. I’ve used Postman for probably over ten years now. I don’t use it terribly often as I can normally whip up a quick API demo in Node in minutes, but I’ll use Postman from time to time. As you can probably guess by how I started this post, my use of Postman was very rudimentary. Heck, I’ve only recently realized the benefit of organizing requests via various collections... more →
Posted in: JavaScript