GithubHelp home page GithubHelp logo

colorable's Introduction

Colorable

Take a set color palette and get contrast values for every possible combination โ€“ useful for finding safe color combinations with predefined colors and includes pass/fail scores for the WCAG accessibility guidelines.

Getting Started

npm i --save colorable

Usage

Pass an array of color strings or an object with color strings as values.

var colorable = require('colorable')

var colors = {
  red: 'red',
  green: 'green',
  blue: 'blue'
}

var result = colorable(colors, { compact: true, threshold: 0 })

Returns an array of colors with combinations for all other colors and their WCAG contrast values.

[
  {
    "hex": "#FF0000",
    "name": "red",
    "combinations": [
      {
        "hex": "#008000",
        "name": "green",
        "contrast": 1.28483997166146,
        "accessibility": {
          "aa": false,
          "aaLarge": false,
          "aaa": false,
          "aaaLarge": false
        }
      },
      {
        "hex": "#0000FF",
        "name": "blue",
        "contrast": 2.148936170212766,
        "accessibility": {
          "aa": false,
          "aaLarge": false,
          "aaa": false,
          "aaaLarge": false
        }
      }
    ]
  },
  ...
]

Accessibility object

Each key is a boolean value indicating if the color contrast meets the following criteria:


Options

compact

Type: Boolean (default: false)

If set to true, the result will be a smaller object that only includes hex value color strings, a name for each color (if an object is passed to the function), contrast, and accessibility values. When set to false, the result also includes the entire harthur/color object for each color, which includes other properties and methods for color manipulation.

threshold

Type: Number (default: 0)

When set, the colorable function only returns combinations that have a contrast above this value. This is useful for only seeing combinations that pass a minimum contrast level.

uniq

Type: Boolean (default: true)

When set to true, the array of colors is passed through lodash.uniq to remove duplicates.


MIT License

colorable's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorable's Issues

Run colorable locally

Make the code for the project accessible to give the possibility to run the project locally.

Same color returns different results

There seems to be inconsistent return based on the input colors. To be more precise i have this input and threshold is set to 0 :

    firstColor: "rgb(255, 255, 255)",
    secondColor: "rgb(255, 255, 255)"
  }

Expected behaviour:
Return combinations array with first object having contrast set to 1;

Actual behaviour:
Returns empty combinations array;

Meanwhile having the same parameters but this input:

    firstColor: "rgba(255, 255, 255, 1)",
    secondColor: "rgb(255, 255, 255)"
  }

returns the expected combinations array with contrast of 1.

Error building project locally

I am submitting a possible bug.

Just came across this issue. This is the first time I cloned the repo and try to build the project. The first I run npm start, to start the web pack dev server, I faced the following error:

โžœ  colorable git:(master) โœ— npm start

> [email protected] start /home/myuser/Documents/forks/colorable
> npm run dev


> [email protected] dev /home/myuser/Documents/forks/colorable
> webpack-dev-server --progress --colors

/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:200
            throw error;
            ^

Error: <css input>:1:20: Failed to find 'basscss-input-range' from /home/myuser/Documents/forks/colorable
    in [ 
        /home/myuser/Documents/forks/colorable
    ]
    at <css input>:1:20
    at resolveFilename (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:525:11)
    at readAtImport (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:281:26)
    at transformAtImport (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:148:14)
    at Object.tryCatch [as try] (/home/myuser/Documents/forks/colorable/node_modules/postcss-message-helpers/index.js:53:12)
    at /home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:147:23
    at Array.map (<anonymous>)
    at parseStyles (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:146:31)
    at /home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:84:30
    at LazyResult.run (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:197:24)
    at LazyResult.sync (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:183:32)
    at LazyResult.stringify (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:214:14)
    at LazyResult.get (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:236:25)
    at cssnext (/home/myuser/Documents/forks/colorable/node_modules/cssnext/dist/index.js:156:21)
    at Object.<anonymous> (/home/myuser/Documents/forks/colorable/docs/data.js:20:8)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --progress --colors`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2018-01-15T09_12_15_129Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2018-01-15T09_12_15_166Z-debug.log

If you read the stack trace you'll find that the problem is a missing dependency: basscss-input-range.

So I installed the dependency: npm i --save-dev basscss-input-range and run the command again npm start. But now I got another error for a missing dependency: basscss-color-input-range

โžœ  colorable git:(master) โœ— npm start                           

> [email protected] start /home/myuser/Documents/forks/colorable
> npm run dev


> [email protected] dev /home/myuser/Documents/forks/colorable
> webpack-dev-server --progress --colors

/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:200
            throw error;
            ^

Error: <css input>:1:51: Failed to find 'basscss-color-input-range' from /home/myuser/Documents/forks/colorable
    in [ 
        /home/myuser/Documents/forks/colorable
    ]
    at <css input>:1:51
    at resolveFilename (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:525:11)
    at readAtImport (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:281:26)
    at transformAtImport (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:148:14)
    at Object.tryCatch [as try] (/home/myuser/Documents/forks/colorable/node_modules/postcss-message-helpers/index.js:53:12)
    at /home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:147:23
    at Array.map (<anonymous>)
    at parseStyles (/home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:146:31)
    at /home/myuser/Documents/forks/colorable/node_modules/postcss-import/index.js:84:30
    at LazyResult.run (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:197:24)
    at LazyResult.sync (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:183:32)
    at LazyResult.stringify (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:214:14)
    at LazyResult.get (/home/myuser/Documents/forks/colorable/node_modules/postcss/lib/lazy-result.js:236:25)
    at cssnext (/home/myuser/Documents/forks/colorable/node_modules/cssnext/dist/index.js:156:21)
    at Object.<anonymous> (/home/myuser/Documents/forks/colorable/docs/data.js:20:8)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --progress --colors`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2018-01-15T09_14_56_252Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2018-01-15T09_14_56_271Z-debug.log

I installed it as well and try the npm start command one more time. This time I was not facing with dependency issues but the webpack failed to comile the project. Bellow I post the stack trace:

โžœ  colorable git:(master) โœ— npm start                                 

> [email protected] start /home/myuser/Documents/forks/colorable
> npm run dev


> [email protected] dev /home/myuser/Documents/forks/colorable
> webpack-dev-server --progress --colors

  0% compile http://localhost:8080/webpack-dev-server/
webpack result is served from /
content is served from /home/myuser/Documents/forks/colorable
Hash: 2b006b4b75f12218229f  
Version: webpack 1.15.0
Time: 2509ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.25 MB       0  [emitted]  main
chunk    {0} bundle.js (main) 1.19 MB [rendered]
    [0] ./docs/entry.js 1.4 kB {0} [built]
    [1] ./~/react/react.js 41 bytes {0} [built]
    [2] ./~/react/lib/React.js 4.79 kB {0} [built]
    [3] ./~/process/browser.js 5.42 kB {0} [built]
    [4] ./~/react/lib/EventPluginUtils.js 6.75 kB {0} [built]
    [5] ./~/react/lib/EventConstants.js 1.56 kB {0} [built]
    [6] ./~/react/lib/keyMirror.js 1.3 kB {0} [built]
    [7] ./~/react/lib/invariant.js 1.54 kB {0} [built]
    [8] ./~/react/lib/ReactChildren.js 4.74 kB {0} [built]
    [9] ./~/react/lib/PooledClass.js 3.27 kB {0} [built]
   [10] ./~/react/lib/ReactFragment.js 5.74 kB {0} [built]
   [11] ./~/react/lib/ReactElement.js 8.27 kB {0} [built]
   [12] ./~/react/lib/ReactContext.js 1.97 kB {0} [built]
   [13] ./~/react/lib/Object.assign.js 1.26 kB {0} [built]
   [14] ./~/react/lib/emptyObject.js 483 bytes {0} [built]
   [15] ./~/react/lib/warning.js 1.9 kB {0} [built]
   [16] ./~/react/lib/emptyFunction.js 1.06 kB {0} [built]
   [17] ./~/react/lib/ReactCurrentOwner.js 738 bytes {0} [built]
   [18] ./~/react/lib/traverseAllChildren.js 7.54 kB {0} [built]
   [19] ./~/react/lib/ReactInstanceHandles.js 10.6 kB {0} [built]
   [20] ./~/react/lib/ReactRootIndex.js 723 bytes {0} [built]
   [21] ./~/react/lib/getIteratorFn.js 1.18 kB {0} [built]
   [22] ./~/react/lib/ReactComponent.js 5.04 kB {0} [built]
   [23] ./~/react/lib/ReactUpdateQueue.js 9.95 kB {0} [built]
   [24] ./~/react/lib/ReactLifeCycle.js 1.25 kB {0} [built]
   [25] ./~/react/lib/ReactInstanceMap.js 1.25 kB {0} [built]
   [26] ./~/react/lib/ReactUpdates.js 9.26 kB {0} [built]
   [27] ./~/react/lib/CallbackQueue.js 2.47 kB {0} [built]
   [28] ./~/react/lib/ReactPerf.js 2.55 kB {0} [built]
   [29] ./~/react/lib/ReactReconciler.js 3.6 kB {0} [built]
   [30] ./~/react/lib/ReactRef.js 2 kB {0} [built]
   [31] ./~/react/lib/ReactOwner.js 3.69 kB {0} [built]
   [32] ./~/react/lib/ReactElementValidator.js 14.2 kB {0} [built]
   [33] ./~/react/lib/ReactPropTypeLocations.js 543 bytes {0} [built]
   [34] ./~/react/lib/ReactPropTypeLocationNames.js 612 bytes {0} [built]
   [35] ./~/react/lib/ReactNativeComponent.js 3.22 kB {0} [built]
   [36] ./~/react/lib/Transaction.js 9.36 kB {0} [built]
   [37] ./~/react/lib/ReactClass.js 30 kB {0} [built]
   [38] ./~/react/lib/ReactErrorUtils.js 843 bytes {0} [built]
   [39] ./~/react/lib/keyOf.js 1.1 kB {0} [built]
   [40] ./~/react/lib/ReactDOM.js 3.29 kB {0} [built]
   [41] ./~/react/lib/mapObject.js 1.47 kB {0} [built]
   [42] ./~/react/lib/ReactDOMTextComponent.js 3.59 kB {0} [built]
   [43] ./~/react/lib/DOMPropertyOperations.js 6.03 kB {0} [built]
   [44] ./~/react/lib/DOMProperty.js 10.2 kB {0} [built]
   [45] ./~/react/lib/quoteAttributeValueForBrowser.js 747 bytes {0} [built]
   [46] ./~/react/lib/escapeTextContentForBrowser.js 850 bytes {0} [built]
   [47] ./~/react/lib/ReactComponentBrowserEnvironment.js 1.29 kB {0} [built]
   [48] ./~/react/lib/ReactDOMIDOperations.js 5.49 kB {0} [built]
   [49] ./~/react/lib/CSSPropertyOperations.js 5.31 kB {0} [built]
   [50] ./~/react/lib/CSSProperty.js 3.14 kB {0} [built]
   [51] ./~/react/lib/ExecutionEnvironment.js 1.13 kB {0} [built]
   [52] ./~/react/lib/camelizeStyleName.js 1.03 kB {0} [built]
   [53] ./~/react/lib/camelize.js 714 bytes {0} [built]
   [54] ./~/react/lib/dangerousStyleValue.js 1.93 kB {0} [built]
   [55] ./~/react/lib/hyphenateStyleName.js 1.01 kB {0} [built]
   [56] ./~/react/lib/hyphenate.js 808 bytes {0} [built]
   [57] ./~/react/lib/memoizeStringOnly.js 778 bytes {0} [built]
   [58] ./~/react/lib/DOMChildrenOperations.js 4.51 kB {0} [built]
   [59] ./~/react/lib/Danger.js 7.19 kB {0} [built]
   [60] ./~/react/lib/createNodesFromMarkup.js 2.69 kB {0} [built]
   [61] ./~/react/lib/createArrayFromMixed.js 2.37 kB {0} [built]
   [62] ./~/react/lib/toArray.js 2.08 kB {0} [built]
   [63] ./~/react/lib/getMarkupWrap.js 3.16 kB {0} [built]
   [64] ./~/react/lib/ReactMultiChildUpdateTypes.js 835 bytes {0} [built]
   [65] ./~/react/lib/setTextContent.js 1.19 kB {0} [built]
   [66] ./~/react/lib/setInnerHTML.js 3.03 kB {0} [built]
   [67] ./~/react/lib/ReactMount.js 31.2 kB {0} [built]
   [68] ./~/react/lib/ReactBrowserEventEmitter.js 12.3 kB {0} [built]
   [69] ./~/react/lib/EventPluginHub.js 8.23 kB {0} [built]
   [70] ./~/react/lib/EventPluginRegistry.js 8.92 kB {0} [built]
   [71] ./~/react/lib/accumulateInto.js 1.74 kB {0} [built]
   [72] ./~/react/lib/forEachAccumulated.js 889 bytes {0} [built]
   [73] ./~/react/lib/ReactEventEmitterMixin.js 1.32 kB {0} [built]
   [74] ./~/react/lib/ViewportMetrics.js 638 bytes {0} [built]
   [75] ./~/react/lib/isEventSupported.js 1.98 kB {0} [built]
   [76] ./~/react/lib/ReactEmptyComponent.js 2.83 kB {0} [built]
   [77] ./~/react/lib/ReactMarkupChecksum.js 1.32 kB {0} [built]
   [78] ./~/react/lib/adler32.js 885 bytes {0} [built]
   [79] ./~/react/lib/containsNode.js 1.23 kB {0} [built]
   [80] ./~/react/lib/isTextNode.js 614 bytes {0} [built]
   [81] ./~/react/lib/isNode.js 718 bytes {0} [built]
   [82] ./~/react/lib/getReactRootElementInContainer.js 888 bytes {0} [built]
   [83] ./~/react/lib/instantiateReactComponent.js 4.59 kB {0} [built]
   [84] ./~/react/lib/ReactCompositeComponent.js 29.4 kB {0} [built]
   [85] ./~/react/lib/ReactComponentEnvironment.js 1.7 kB {0} [built]
   [86] ./~/react/lib/shouldUpdateReactComponent.js 4.09 kB {0} [built]
   [87] ./~/react/lib/ReactDOMComponent.js 17 kB {0} [built]
   [88] ./~/react/lib/ReactMultiChild.js 12 kB {0} [built]
   [89] ./~/react/lib/ReactChildReconciler.js 4.17 kB {0} [built]
   [90] ./~/react/lib/flattenChildren.js 1.68 kB {0} [built]
   [91] ./~/react/lib/ReactDefaultInjection.js 5.44 kB {0} [built]
   [92] ./~/react/lib/BeforeInputEventPlugin.js 15.1 kB {0} [built]
   [93] ./~/react/lib/EventPropagators.js 4.65 kB {0} [built]
   [94] ./~/react/lib/FallbackCompositionState.js 2.38 kB {0} [built]
   [95] ./~/react/lib/getTextContentAccessor.js 1 kB {0} [built]
   [96] ./~/react/lib/SyntheticCompositionEvent.js 1.14 kB {0} [built]
   [97] ./~/react/lib/SyntheticEvent.js 4.85 kB {0} [built]
   [98] ./~/react/lib/getEventTarget.js 931 bytes {0} [built]
   [99] ./~/react/lib/SyntheticInputEvent.js 1.12 kB {0} [built]
  [100] ./~/react/lib/ChangeEventPlugin.js 11.5 kB {0} [built]
  [101] ./~/react/lib/isTextInputElement.js 975 bytes {0} [built]
  [102] ./~/react/lib/ClientReactRootIndex.js 551 bytes {0} [built]
  [103] ./~/react/lib/DefaultEventPluginOrder.js 1.34 kB {0} [built]
  [104] ./~/react/lib/EnterLeaveEventPlugin.js 3.86 kB {0} [built]
  [105] ./~/react/lib/SyntheticMouseEvent.js 2.2 kB {0} [built]
  [106] ./~/react/lib/SyntheticUIEvent.js 1.6 kB {0} [built]
  [107] ./~/react/lib/getEventModifierState.js 1.33 kB {0} [built]
  [108] ./~/react/lib/HTMLDOMPropertyConfig.js 6.53 kB {0} [built]
  [109] ./~/react/lib/MobileSafariClickEventPlugin.js 1.72 kB {0} [built]
  [110] ./~/react/lib/ReactBrowserComponentMixin.js 715 bytes {0} [built]
  [111] ./~/react/lib/findDOMNode.js 2.4 kB {0} [built]
  [112] ./~/react/lib/ReactDefaultBatchingStrategy.js 1.91 kB {0} [built]
  [113] ./~/react/lib/ReactDOMButton.js 1.61 kB {0} [built]
  [114] ./~/react/lib/AutoFocusMixin.js 595 bytes {0} [built]
  [115] ./~/react/lib/focusNode.js 728 bytes {0} [built]
  [116] ./~/react/lib/ReactDOMForm.js 1.64 kB {0} [built]
  [117] ./~/react/lib/LocalEventTrapMixin.js 1.74 kB {0} [built]
  [118] ./~/react/lib/ReactDOMImg.js 1.41 kB {0} [built]
  [119] ./~/react/lib/ReactDOMIframe.js 1.37 kB {0} [built]
  [120] ./~/react/lib/ReactDOMInput.js 5.91 kB {0} [built]
  [121] ./~/react/lib/LinkedValueUtils.js 4.75 kB {0} [built]
  [122] ./~/react/lib/ReactPropTypes.js 11.1 kB {0} [built]
  [123] ./~/react/lib/ReactDOMOption.js 1.34 kB {0} [built]
  [124] ./~/react/lib/ReactDOMSelect.js 5.21 kB {0} [built]
  [125] ./~/react/lib/ReactDOMTextarea.js 4.71 kB {0} [built]
  [126] ./~/react/lib/ReactEventListener.js 5.51 kB {0} [built]
  [127] ./~/react/lib/EventListener.js 2.67 kB {0} [built]
  [128] ./~/react/lib/getUnboundedScrollPosition.js 1.09 kB {0} [built]
  [129] ./~/react/lib/ReactInjection.js 1.47 kB {0} [built]
  [130] ./~/react/lib/ReactReconcileTransaction.js 4.92 kB {0} [built]
  [131] ./~/react/lib/ReactInputSelection.js 4.25 kB {0} [built]
  [132] ./~/react/lib/ReactDOMSelection.js 6.14 kB {0} [built]
  [133] ./~/react/lib/getNodeForCharacterOffset.js 1.66 kB {0} [built]
  [134] ./~/react/lib/getActiveElement.js 788 bytes {0} [built]
  [135] ./~/react/lib/ReactPutListenerQueue.js 1.33 kB {0} [built]
  [136] ./~/react/lib/SelectEventPlugin.js 5.84 kB {0} [built]
  [137] ./~/react/lib/shallowEqual.js 1.1 kB {0} [built]
  [138] ./~/react/lib/ServerReactRootIndex.js 868 bytes {0} [built]
  [139] ./~/react/lib/SimpleEventPlugin.js 12.5 kB {0} [built]
  [140] ./~/react/lib/SyntheticClipboardEvent.js 1.22 kB {0} [built]
  [141] ./~/react/lib/SyntheticFocusEvent.js 1.08 kB {0} [built]
  [142] ./~/react/lib/SyntheticKeyboardEvent.js 2.72 kB {0} [built]
  [143] ./~/react/lib/getEventCharCode.js 1.56 kB {0} [built]
  [144] ./~/react/lib/getEventKey.js 2.93 kB {0} [built]
  [145] ./~/react/lib/SyntheticDragEvent.js 1.09 kB {0} [built]
  [146] ./~/react/lib/SyntheticTouchEvent.js 1.3 kB {0} [built]
  [147] ./~/react/lib/SyntheticWheelEvent.js 1.99 kB {0} [built]
  [148] ./~/react/lib/SVGDOMPropertyConfig.js 2.8 kB {0} [built]
  [149] ./~/react/lib/createFullPageComponent.js 1.9 kB {0} [built]
  [150] ./~/react/lib/ReactDefaultPerf.js 8.55 kB {0} [built]
  [151] ./~/react/lib/ReactDefaultPerfAnalysis.js 5.67 kB {0} [built]
  [152] ./~/react/lib/performanceNow.js 767 bytes {0} [built]
  [153] ./~/react/lib/performance.js 625 bytes {0} [built]
  [154] ./~/react/lib/ReactServerRendering.js 2.58 kB {0} [built]
  [155] ./~/react/lib/ReactServerRenderingTransaction.js 2.72 kB {0} [built]
  [156] ./~/react/lib/onlyChild.js 1.23 kB {0} [built]
  [157] ./~/react-router/lib/index.js 1.41 kB {0} [built]
  [158] ./~/react-router/lib/components/DefaultRoute.js 2.34 kB {0} [built]
  [159] ./~/react-router/lib/PropTypes.js 706 bytes {0} [built]
  [160] ./~/react-router/~/object-assign/index.js 484 bytes {0} [built]
  [161] ./~/react-router/lib/Route.js 8.3 kB {0} [built]
  [162] ./~/invariant/browser.js 1.52 kB {0} [built]
  [163] ./~/react-router/lib/warning.js 1.95 kB {0} [built]
  [164] ./~/react-router/lib/PathUtils.js 4.22 kB {0} [built]
  [165] ./~/qs/index.js 36 bytes {0} [built]
  [166] ./~/qs/lib/index.js 200 bytes {0} [built]
  [167] ./~/qs/lib/stringify.js 2.32 kB {0} [built]
  [168] ./~/qs/lib/utils.js 2.4 kB {0} [built]
  [169] ./~/qs/lib/parse.js 4.04 kB {0} [built]
  [170] ./~/react-router/lib/components/RouteHandler.js 4.61 kB {0} [built]
  [171] ./~/react-router/lib/components/ContextWrapper.js 2.6 kB {0} [built]
  [172] ./~/react-router/lib/components/Route.js 4.28 kB {0} [built]
  [173] ./~/react-router/lib/components/Link.js 5.56 kB {0} [built]
  [174] ./~/react-router/lib/components/NotFoundRoute.js 2.4 kB {0} [built]
  [175] ./~/react-router/lib/components/Redirect.js 2.19 kB {0} [built]
  [176] ./~/react-router/lib/locations/HashLocation.js 2.67 kB {0} [built]
  [177] ./~/react-router/lib/actions/LocationActions.js 410 bytes {0} [built]
  [178] ./~/react-router/lib/History.js 577 bytes {0} [built]
  [179] ./~/can-use-dom/index.js 139 bytes {0} [built]
  [180] ./~/react-router/lib/locations/HistoryLocation.js 1.9 kB {0} [built]
  [181] ./~/react-router/lib/locations/RefreshLocation.js 615 bytes {0} [built]
  [182] ./~/react-router/lib/locations/StaticLocation.js 1.83 kB {0} [built]
  [183] ./~/react-router/lib/locations/TestLocation.js 2.86 kB {0} [built]
  [184] ./~/react-router/lib/behaviors/ImitateBrowserBehavior.js 663 bytes {0} [built]
  [185] ./~/react-router/lib/behaviors/ScrollToTopBehavior.js 270 bytes {0} [built]
  [186] ./~/react-router/lib/Navigation.js 1.67 kB {0} [built]
  [187] ./~/react-router/lib/State.js 1.65 kB {0} [built]
  [188] ./~/react-router/lib/createRoutesFromReactChildren.js 2.47 kB {0} [built]
  [189] ./~/react-router/lib/createRouter.js 17.2 kB {0} [built]
  [190] ./~/react-router/lib/ScrollHistory.js 2.09 kB {0} [built]
  [191] ./~/react-router/lib/getWindowScrollPosition.js 472 bytes {0} [built]
  [192] ./~/react-router/lib/isReactChildren.js 295 bytes {0} [built]
  [193] ./~/react-router/lib/Transition.js 2.02 kB {0} [built]
  [194] ./~/react-router/lib/Cancellation.js 190 bytes {0} [built]
  [195] ./~/react-router/lib/Redirect.js 200 bytes {0} [built]
  [196] ./~/react-router/lib/Match.js 2.93 kB {0} [built]
  [197] ./~/react-router/lib/supportsHistory.js 665 bytes {0} [built]
  [198] ./~/react-router/lib/runRouter.js 1.21 kB {0} [built]
  [199] ./docs/Routes.jsx 1.09 kB {0} [built]
  [200] ./docs/components/Root.jsx 1.16 kB {0} [built]
  [201] ./docs/components/Head.jsx 703 bytes {0} [built]
  [202] ./docs/components/Nav.jsx 1.72 kB {0} [built]
  [203] ./docs/components/Footer.jsx 1.17 kB {0} [built]
  [204] ./docs/components/Index.jsx 502 bytes {0} [built]
  [205] ./docs/components/Header.jsx 830 bytes {0} [built]
  [206] ./docs/components/Ad.jsx 332 bytes {0} [built]
  [207] ./docs/components/TweetButton.jsx 601 bytes {0} [built]
  [208] ./docs/components/Readme.jsx 296 bytes {0} [built]
  [209] ./docs/components/Demos.jsx 1.39 kB {0} [built]
  [210] ./docs/components/TextDemo.jsx 2.88 kB {0} [built]
  [211] ./~/lodash/index.js 411 kB {0} [built]
  [212] (webpack)/buildin/module.js 251 bytes {0} [built]
  [213] ./~/query-string/index.js 1.39 kB {0} [built]
  [214] ./~/strict-uri-encode/index.js 182 bytes {0} [built]
  [215] ./index.js 1.78 kB {0} [built]
  [216] ./~/color/color.js 11.8 kB {0} [built]
  [217] ./~/color-convert/index.js 2.32 kB {0} [built]
  [218] ./~/color-convert/conversions.js 14.6 kB {0} [built]
  [219] ./~/color-string/color-string.js 5.67 kB {0} [built]
  [220] ./~/color-name/index.json 3.71 kB {0} [built]
  [221] ./docs/components/ColorPreview.jsx 1.75 kB {0} [built]
  [222] ./docs/components/HeadingBadge.jsx 734 bytes {0} [built]
  [223] ./docs/components/ForegroundBackgroundForm.jsx 2.18 kB {0} [built]
  [224] ./~/react-hsl-sliders/hsl-sliders.js 2.84 kB {0} [built]
  [225] ./docs/components/MatrixDemo.jsx 3.72 kB {0} [built]
  [226] ./docs/components/SuperModal.jsx 1.83 kB {0} [built]
  [227] ./docs/components/MatrixRow.jsx 540 bytes {0} [built]
  [228] ./docs/components/Chip.jsx 879 bytes {0} [built]
  [229] ./docs/components/Badge.jsx 882 bytes {0} [built]
  [230] ./docs/components/ColorList.jsx 2.11 kB {0} [built]
  [231] ./docs/components/ColorListItem.jsx 2.21 kB {0} [built]
  [232] ./docs/components/Toolbar.jsx 839 bytes {0} [built]
  [233] ./docs/components/ThresholdToggle.jsx 1.52 kB {0} [built]
  [234] ./~/classnames/index.js 1.1 kB {0} [built]

ERROR in TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at safeStringify (bundle.js:23875:16)
    at Constructor.render (bundle.js:23854:16)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (bundle.js:11898:35)
    at ReactCompositeComponentWrapper._renderValidatedComponent (bundle.js:11925:15)
    at ReactCompositeComponentWrapper.wrapper [as _renderValidatedComponent] (bundle.js:3631:22)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11346:31)
    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (bundle.js:3631:22)
    at Object.mountComponent (bundle.js:3706:36)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11356:35)

ERROR in TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at safeStringify (bundle.js:23875:16)
    at Constructor.render (bundle.js:23854:16)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (bundle.js:11898:35)
    at ReactCompositeComponentWrapper._renderValidatedComponent (bundle.js:11925:15)
    at ReactCompositeComponentWrapper.wrapper [as _renderValidatedComponent] (bundle.js:3631:22)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11346:31)
    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (bundle.js:3631:22)
    at Object.mountComponent (bundle.js:3706:36)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11356:35)

ERROR in TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at safeStringify (bundle.js:23875:16)
    at Constructor.render (bundle.js:23854:16)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (bundle.js:11898:35)
    at ReactCompositeComponentWrapper._renderValidatedComponent (bundle.js:11925:15)
    at ReactCompositeComponentWrapper.wrapper [as _renderValidatedComponent] (bundle.js:3631:22)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11346:31)
    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (bundle.js:3631:22)
    at Object.mountComponent (bundle.js:3706:36)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11356:35)

ERROR in TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at safeStringify (bundle.js:23875:16)
    at Constructor.render (bundle.js:23854:16)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (bundle.js:11898:35)
    at ReactCompositeComponentWrapper._renderValidatedComponent (bundle.js:11925:15)
    at ReactCompositeComponentWrapper.wrapper [as _renderValidatedComponent] (bundle.js:3631:22)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11346:31)
    at ReactCompositeComponentWrapper.wrapper [as mountComponent] (bundle.js:3631:22)
    at Object.mountComponent (bundle.js:3706:36)
    at ReactCompositeComponentWrapper.mountComponent (bundle.js:11356:35)
webpack: Failed to compile.

I read the error: ERROR in TypeError: Converting circular structure to JSON but could not come into a conclution on what exactly might be the problem.

@jxnblk I mention you cause I read the closed issue #6 and thought you are the right person to ask. Does this issue affect only my machine?

Wrong threshold

The relative luminance definition as listed in the WCAG 2.x specification is known to be incorrect and not per the official IEC standard for sRGB.

Specifically, the correct threshold for the piecewise equation is 0.04045 and not the 0.03928:
https://www.w3.org/WAI/GL/wiki/Relative_luminance

Here every value is wrong ๐Ÿ˜ต

feature request: Update <title> with the hex code of the colours

At the outset, thanks so much for this tool! โœจ

As I'm going through the various random ones here, I'm bookmarking them for later use. The permalinks are really useful for this.

The one thing I'd like to have is that the title be automatically updated with the hex colours so that the bookmark become unique

Thanks once again for this, Brent.

Color opacity

Guys, thanks for a very useful and handy tool. I would only like to ask you to add the ability to change the opacity of the colors. TY

Demo page is down

I didn't realize what an important part of my work Colorable has become until I couldn't access the demo page today. I hope this is a temporary hiccup, not a step toward retiring such a wonderful tool, and what I consider the finest color tester for ADA-compliance available.
screenshot 2019-01-13 at 4 25 03 pm

Invert slider colour as well as handles?

When a colour becomes dark enough, the text in the box flips form black to white, and so do the slider handles. It would be great if the slider itself would too, so that we can see where it starts and ends more clearly.

(Thanks for this awesome tool, BTW!)

Feature Requst: Arrange Colors After Initial Placement

First - amazing... This application is a huge help.

Suggestion: Add the ability to re-arrange the original colors after initially setting them.

For instance: I've entered my set of colors in the list; however, I have one which I'd like grouped with similar colors. Currently I'd have to re-enter them all to accomplish this task. What I'd like is a way to enter one at the bottom then have a handle to move it up to another spot in the list.

Thank you!

URL stopped working

Thank you so much for this wonderful little tool. I love the way you've designed it.

As of late, I notice that linking someone URLs with colour values seem to 404. For example: https://colorable.jxnblk.com/3d93f7/292929
image

If it is at all in your power to fix this, I would appreciate it a lot.
Best to you,
Richard

Feature request: redesigned interface, showing more contrast

I regularly use both https://colorable.jxnblk.com and https://marijohannessen.github.io/color-contrast-checker/

The first one for the HSL sliders, and the second one for the design. Design = Function. Yes, I think it looks nice, but it is not just about looking nice, it is also more functional: it shows the contrast between the foreground and the background colors in a much better way. Colors can only be fully appreciated when there is contrast. This https://colorable.jxnblk.com only shows a full screen colored background with letters in the foreground. So this https://marijohannessen.github.io/color-contrast-checker/ is doing much better on this.

It also comes with nice features such as uppercase hex values and lighten on mouse over.

Quick mockup:

image

Aa vs. AAA

Just a very small idea: Since we are looking for the โ€žAAAโ€œ and โ€žAAโ€œ results, the letters โ€žAaโ€œ in the beginning look fairly similar. It is somewhat doubled and therefore irritates me every time. Maybe change the โ€žAaโ€œ to some other letters, a pangram like Sphinx or Jxnblk?

(Apart from that, love your tool, thank you! <3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.