How to use the chroma-js.blend function in chroma-js

To help you get started, we’ve selected a few chroma-js 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 aredotna / ervell / react / components / UI / GenericButton / index.js View on Github external
export const buttonColor = (props) => {
  const value = themeGet(`colors.${props.color}`, props.theme.colors.gray.base)(props);

  return `
    color: ${value};
    border-color: ${chroma.blend(value, '#bbb', 'screen')};
  `;
};
github mohakapt / react-native-js-tableview / src / assets / colors.js View on Github external
export const blendColors = (theme, color, accent) => {
	const alteredAccent = chroma(accent).set('hsv.s', 0.03).set('hsv.v', 1).hex();
	const blendMode = theme === 'dark' ? 'burn' : 'multiply';

	return chroma.blend(color, alteredAccent, blendMode).hex();
};
github aredotna / ervell / src / v2 / styles / mixins.js View on Github external
${props => {
    const color =
      theme.colors.channel[props.visibility] ||
      themeGet(`colors.${props.color}`, props.theme.colors.gray.base)(props)

    return `
      color: ${color};
      border-color: ${
        props.mode === 'hover'
          ? `border-color: ${color};`
          : blend(color, '#bbb', 'screen')
      };

      &:hover {
        border-color: ${color};
      }
    `
  }}
`
github microsoft / fast-dna / packages / fast-colors / src / range.ts View on Github external
return (background: Color, foreground: Color, value: number): Chroma => {
        const adjustment: Chroma = Chroma.blend(background, foreground, name);
        return Chroma.mix(foreground, adjustment, value, "rgb");
    };
}
github aredotna / ervell / react / styles / mixins.js View on Github external
${(props) => {
    const color = theme.colors.channel[props.visibility] ||
      themeGet(`colors.${props.color}`, props.theme.colors.gray.base)(props);

    return `
      color: ${color};
      border-color: ${props.mode === 'hover' ? `border-color: ${color};` : blend(color, '#bbb', 'screen')};

      &:hover {
        border-color: ${color};
      }
    `;
  }}
`;
github aredotna / ervell / src / v2 / components / UI / GenericButton / index.js View on Github external
export const buttonColor = props => {
  const value = themeGet(`colors.${props.color}`, props.theme.colors.gray.base)(
    props
  )

  return `
    color: ${value};
    border-color: ${chroma.blend(value, '#bbb', 'screen')};
  `
}