How to use css-color-names - 2 common examples

To help you get started, we’ve selected a few css-color-names examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github btholt / postcss-colorblind / test / suite.js View on Github external
testColorMutation,
  `#FFCC00`
);

test(
  'should do a simple hex achromatopsia transform',
  testColorMutation,
  `#D929E2`,
  'achromatopsia'
);

test(
  'should do a simple named color deuteranopia transform',
  testPostCSS,
  `.some-color { border: 3px red solid; font-size: 12px }`,
  `.some-color { border: 3px ${colorblind.deuteranopia(colorNames.red)} solid; font-size: 12px }`
);

test(
  'should do a multi tritanopia transform',
  testPostCSS,
  `.some-color { border: 3px #D929E2 solid; color: lime }`,
  `.some-color { border: 3px ${colorblind.tritanopia('#D929E2')} solid; color: ${colorblind.tritanopia('lime')} }`,
  {method: 'tritanopia'}
);

test(
  'should work inside gradients',
  testPostCSS,
  `.some-color { background: linear-gradient(#000000, hsla(120, 30%, 80%, .8)) }`,
  `.some-color { background: linear-gradient(#000000, ${onecolor(colorblind.deuteranopia('#bddbbd')).alpha('0.8').cssa()}) }`
);
github morishitter / is-color / index.js View on Github external
const isKeyword = function (str) { return keywords.hasOwnProperty(str) }
const isInherit = function (str) { return str === 'inherit' }

css-color-names

A JSON Object of css color names mapped to their hex value

MIT
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis

Popular css-color-names functions