Created
November 29, 2020 17:36
-
-
Save nanzhong/4fd76d9a27c768f0228620f1c41443d6 to your computer and use it in GitHub Desktop.
Copic Colours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'open-uri' | |
colours = {} | |
URI.open("https://copic.jp/en/about/color_system/") do |f| | |
matches = f.read.scan(/<td class="c_([a-fA-F0-9]{6})">(?:<span>)?([\w-]+)/) | |
matches.each do |hex, name| | |
colours[name] = "##{hex}" | |
end | |
end | |
puts JSON.pretty_generate(colours) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment