{"id":2344,"date":"2019-09-07T13:00:41","date_gmt":"2019-09-07T12:00:41","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2344"},"modified":"2019-09-07T17:24:46","modified_gmt":"2019-09-07T16:24:46","slug":"my-github-noops-hexbot","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2344\/my-github-noops-hexbot\/","title":{"rendered":"My Github Noops Hexbot"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2348\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2344\/my-github-noops-hexbot\/github_hexbot-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"github_hexbot\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2348\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot-1.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This blog post talks about my entry to the Github Noops Challenge for the Hexbot API.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">What the API does?<\/h2>\n\n\n\n<p>This API lets you retrieve one or many random hex codes. This relatively simple API gives a lot of scope to try various different ways of using a hex code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What my Hexbot Noop does<\/h2>\n\n\n\n<p>I wanted to display the hex code numerically and in colour, but I also wanted to transform it into different forms.<\/p>\n\n\n\n<p>Every 15 seconds a new colour is requested. Once requested the page will transition to the new colour.<\/p>\n\n\n\n<p>The transitioning works by calculating the vector difference between the current and new colour. This difference vector is used to create several colours to act as transition points. Once calculated the page slowly transitions through the points until it reaches the new colour.<\/p>\n\n\n\n<p>There are twelve colour panels displayed on the page. On the left is the colour given by the API and 5 transformed colours, RBG, BRG, BGR, GBR, and GRB.<\/p>\n\n\n\n<p>On the right hand side there are the same 6 colour permutations, with the inverted colour given by the API. <\/p>\n\n\n\n<p>Inversion of the colour is performed by converting the hex code into individual R, G, B components and removing their value from 255 to get the new value.<\/p>\n\n\n\n<p>The colour of the text is decided by calculating the HSP value for each of the codes. If the value is less than (255\/2) then the text will be white. If it is higher than this value the text colour will be black. This ensures that the text colour is chosen to contrast nicely with the colour.<\/p>\n\n\n\n<p>HSP is calculated as documented <a href=\"http:\/\/alienryderflex.com\/hsp.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">by Darel Rex Finley<\/a>.<\/p>\n\n\n\n<p>You can find my Noop available on my website  <a href=\"https:\/\/chewett.co.uk\/noops\/hexbot\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">https:\/\/chewett.co.uk\/noops\/hexbot\/<\/a> .<\/p>\n\n\n\n<p>I look forward to talking about the next one, the Vexbot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post talks about my entry to the Github Noops Challenge for the Hexbot API.<\/p>\n","protected":false},"author":1,"featured_media":2347,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[98],"tags":[226,76,72,360],"class_list":["post-2344","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-api","tag-github","tag-javascript","tag-noops-challenge"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/09\/github_hexbot.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-BO","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2328,"url":"https:\/\/chewett.co.uk\/blog\/2328\/participating-in-the-github-noops-challenge\/","url_meta":{"origin":2344,"position":0},"title":"Participating in the Github Noops Challenge","author":"Chewett","date":"August 17, 2019","format":false,"excerpt":"In this post I talk a little about the Github Noops challenge and what I plan to do. What is the Noops Challenge? Github have created a number of challenges that encourage you to create something. Each challenge exposes an API with some options that you can customise. One of\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/08\/github_noops_challenge-1.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/08\/github_noops_challenge-1.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/08\/github_noops_challenge-1.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/08\/github_noops_challenge-1.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1088,"url":"https:\/\/chewett.co.uk\/blog\/1088\/pokemon-go-api-shiny-pokemon-list\/","url_meta":{"origin":2344,"position":1},"title":"Pokemon Go API &#8211; Shiny Pokemon List","author":"Chewett","date":"March 31, 2018","format":false,"excerpt":"This post talks about the latest API I have added to PoGoAPI.net, the Shiny Pokemon list. What the Shiny Pokemon List can be used for In Pokemon Go some pokemon are able to be shiny and these will appear a different colour to the normal Pokemon. These have no differences\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/pogo_api_shiny_pokemon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/pogo_api_shiny_pokemon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/pogo_api_shiny_pokemon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/pogo_api_shiny_pokemon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":989,"url":"https:\/\/chewett.co.uk\/blog\/989\/introducing-pokemon-go-data-api-pogoapi-net\/","url_meta":{"origin":2344,"position":2},"title":"Introducing the Pokemon Go Data API &#8211; pogoapi.net","author":"Chewett","date":"February 3, 2018","format":false,"excerpt":"This post introduces the Pokemon Go API website, PoGoAPI.net and what I plan to do with it. Whats the website? PoGoAPI.net! I started to play around with some data visualization and tools to help play Pokemon Go. However I couldn't find the information I wanted easily. Lists of information is\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/pogo_api_released.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/pogo_api_released.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/pogo_api_released.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/pogo_api_released.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1814,"url":"https:\/\/chewett.co.uk\/blog\/1814\/pokemon-go-api-player-xp-requirements-api\/","url_meta":{"origin":2344,"position":3},"title":"Pokemon Go API \u2013 Player XP Requirements API","author":"Chewett","date":"April 20, 2019","format":false,"excerpt":"This post talks about the newest Pokemon Go API, the Player XP Requirements API at\u00a0pogoapi.net. Player XP Requirements For each Pokemon Go level you are required to reach a specific amount of cumulative xp. For each level this will be shown as the amount of xp required to get to\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/pogo_api_player_xp_requirements-1.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/pogo_api_player_xp_requirements-1.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/pogo_api_player_xp_requirements-1.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/12\/pogo_api_player_xp_requirements-1.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2162,"url":"https:\/\/chewett.co.uk\/blog\/2162\/pokemon-go-api-api-hashes-api\/","url_meta":{"origin":2344,"position":4},"title":"Pokemon Go API \u2013 API Hashes API","author":"Chewett","date":"May 1, 2019","format":false,"excerpt":"This post talks about the newest Pokemon Go API, the API Hashes API at pogoapi.net. Using the API Hashes API It is recommended to locally cache the API files so you can store them on your own server and use them as needed. To help facilitate this hash API is\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/pogo_api_hashes.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/pogo_api_hashes.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/pogo_api_hashes.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/pogo_api_hashes.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2623,"url":"https:\/\/chewett.co.uk\/blog\/2623\/pokemon-go-api-research-task-exclusive-pokemon-api\/","url_meta":{"origin":2344,"position":5},"title":"Pokemon Go API &#8211; Research Task Exclusive Pokemon API","author":"Chewett","date":"September 19, 2020","format":false,"excerpt":"This post talks about the latest API I have added to PoGoAPI.net, the Research Task Exclusive Pokemon API. What is the Research Task Exclusive Pokemon API Some Pokemon and their evolutions are only available by completing research tasks. To get these you will have to find the research task by\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/pogo_api_raid_research_exclusive_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2344"}],"version-history":[{"count":7,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2344\/revisions"}],"predecessor-version":[{"id":2354,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2344\/revisions\/2354"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2347"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}