Updated 08172022-155216
here's a real simple colornames.org API-based shortcut that retrieves, marks up, and combines color images into a grid. https://routinehub.co/shortcut/12841
This shortcut queries the latest submissions endpoint of the Colornames.org API, using the hexCode
values and Actions' Create Color Image action to generate 400px x 300px solid color images of each value. It then uses the native Overlay Text action to overlay the name
values on the images. After the repeat loops for the full 100 counts, the results are passed through a Combine Images action to produce a grid like this:
Upon installation, you will be asked to specify a locally-installed typeface for the text overlays as well as the directory in which you'd like the results saved.
import Shortcuts
#Color: teal, #Icon: paintbrush
/*
Generate a grid of solid color, marked-up images of Colornames'org's latest 100 submissions.
Data source: https://colornames.org/fresh/json
More documentation: https://colornames.org/download
My contact information:
Email: davidblue@extratone.com
Contact card: bit.ly/whoisdavidblue
RoutineHub Profile: https://routinehub.co/user/blue
GitHub: https://github.com/extratone/i
Telegram: t.me/extratone
Twitter: twitter.com/NeoYokel
Reddit: reddit.com/u/asphaltapostle
Mastodon: mastodon.social/@DavidBlue
EVERYWHERE: bit.ly/dbrolodex
*/
url(url: "https://colornames.org/fresh/json/") >> url
downloadURL(url: "${URL}") >> downloadURL
repeatEach(Contents of URL) {
valueFor(key: "hexCode", dictionary: Repeat Item) >> valueFor
valueFor(key: "name", dictionary: Repeat Item) >> valueFor 1
//Unable to get shortcuts action com.sindresorhus.Actions.CreateColorImageIntent
overlayText(image: Solid Color Image, text: "${Dictionary Value}", position: Bottom Center) >> overlayText
//Unable to get shortcuts action is.workflow.actions.appendvariable
} >> RepeatResult
combineImage(images: images, mode: In a Grid, spacing: 0) >> combineImage
setName(input: Combined Image, name: "${CurrentDate}", dontIncludeExtension: false) >> setName
saveFile(input: Renamed Item, ask: false) >> saveFile