├── README.md ├── compositor.json ├── index.js ├── package.json └── test.js /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Bikeshed 3 | 4 | What color should we paint this thing? 5 | 6 | ## Features 7 | 8 | - Endless debate over the color of something that doesn’t really matter 9 | - Safely ignore the reactor core design, because who even knows 10 | - Potential for last minute poop-and-swoop from key stakeholders 11 | - Designed by committee, because everyone knows what they’re doing 12 | - Frequent updates and unnecessary changes 13 | 14 | ## Getting Started 15 | 16 | ```js 17 | npm install @jxnblk/bikeshed 18 | ``` 19 | 20 | ```js 21 | const bikeshed = require('@jxnblk/bikeshed') 22 | 23 | const color = bikeshed() 24 | // returns a random hex color string 25 | ``` 26 | 27 | MIT License 28 | 29 | -------------------------------------------------------------------------------- /compositor.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jxnblk/bikeshed", 3 | "version": "0.1.4", 4 | "libraries": { 5 | "xv": "^1.1.10" 6 | }, 7 | "title": "", 8 | "branch": "", 9 | "style": { 10 | "name": "Future", 11 | "componentSet": { 12 | "nav": "nav/BasicNav", 13 | "header": "header/BannerHeader", 14 | "article": "article/BasicArticle", 15 | "footer": "footer/BasicFooter" 16 | }, 17 | "fontFamily": "\"Avenir Next\", Helvetica, sans-serif", 18 | "heading": { 19 | "fontWeight": 500, 20 | "textTransform": "uppercase", 21 | "letterSpacing": "0.2em" 22 | }, 23 | "alternativeText": { 24 | "textTransform": "uppercase", 25 | "fontWeight": 400, 26 | "letterSpacing": "0.2em", 27 | "opacity": 0.75 28 | }, 29 | "colors": { 30 | "text": "#333", 31 | "background": "#fff", 32 | "primary": "#666", 33 | "secondary": "#888", 34 | "highlight": "#1f80ff", 35 | "muted": "#f6f6f6", 36 | "border": "#eee" 37 | }, 38 | "layout": { 39 | "centered": true, 40 | "maxWidth": 1024, 41 | "bannerHeight": "80vh" 42 | } 43 | }, 44 | "content": [ 45 | { 46 | "component": "nav", 47 | "links": [ 48 | { 49 | "href": "https://github.com/jxnblk/bikeshed", 50 | "text": "GitHub" 51 | }, 52 | { 53 | "href": "https://npmjs.com/package/@jxnblk/bikeshed", 54 | "text": "npm" 55 | } 56 | ] 57 | }, 58 | { 59 | "component": "header", 60 | "heading": "bikeshed", 61 | "subhead": "What color should we paint this thing?", 62 | "children": [ 63 | { 64 | "component": "ui/TweetButton", 65 | "text": "bikeshed: What color should we paint this thing?", 66 | "url": null 67 | }, 68 | { 69 | "component": "ui/GithubButton", 70 | "user": "jxnblk", 71 | "repo": "bikeshed" 72 | } 73 | ], 74 | "text": "v1.0.0-beta.1" 75 | }, 76 | { 77 | "component": "article", 78 | "metadata": { 79 | "source": "github.readme" 80 | }, 81 | "html": "\n
What color should we paint this thing?
\nnpm install @jxnblk/bikeshed
const bikeshed = require('@jxnblk/bikeshed')\n\nconst color = bikeshed()\n// returns a random hex color string
MIT License
\n" 82 | }, 83 | { 84 | "component": "footer", 85 | "links": [ 86 | { 87 | "href": "https://github.com/jxnblk/bikeshed", 88 | "text": "GitHub" 89 | }, 90 | { 91 | "href": "https://github.com/jxnblk", 92 | "text": "jxnblk" 93 | } 94 | ] 95 | } 96 | ] 97 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | const bikeshed = () => { 3 | const hex = Math.floor(Math.random() * 16777215).toString(16) 4 | const pad = '000000' 5 | 6 | return '#' + (pad + hex).slice(-pad.length) 7 | } 8 | 9 | module.exports = bikeshed 10 | 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jxnblk/bikeshed", 3 | "version": "1.0.0-beta.1", 4 | "description": "What color should we paint this thing?", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "node test.js" 8 | }, 9 | "keywords": [], 10 | "author": "Brent Jackson", 11 | "license": "MIT" 12 | } 13 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 2 | const assert = require('assert') 3 | const bikeshed = require('./index') 4 | 5 | const hex = bikeshed() 6 | 7 | assert(typeof hex === 'string') 8 | assert(hex.length === 7) 9 | assert(/^#[0-9a-f]{6}/.test(hex)) 10 | 11 | console.log('OK', hex) 12 | 13 | --------------------------------------------------------------------------------