Skip to content

Instantly share code, notes, and snippets.

@nawada
Created May 18, 2022 08:52
Show Gist options
  • Save nawada/c2f0b6e9fc9ef13c824afcae3289a058 to your computer and use it in GitHub Desktop.
Save nawada/c2f0b6e9fc9ef13c824afcae3289a058 to your computer and use it in GitHub Desktop.
// https://tumoiyorozu.github.io/white200/
// 「スタート」「本番開始」ボタンを押したあと、 F12 で開発者ツール開いて以下を貼り付けてEnterでおk
const questionText = document.querySelector('#problem_text').innerText;
const colorText = questionText.match(/#([a-z0-9]{6})/)[1];
const rText = colorText.substr(0, 2);
const gText = colorText.substr(2, 2);
const bText = colorText.substr(4, 2);
const r = Number.parseInt(rText, 16);
const g = Number.parseInt(gText, 16);
const b = Number.parseInt(bText, 16);
submit(r, g, b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment