Vue Color Blender/Shader/Converter
Lightweight color shader/blender/converter plugin implemented for Vue 2.
Disclaimer
The algoritmn used in this plugin was not developed by me, I am just wrapping it for Vue. Pimp Trizkit is the algoritmn author, for more information visit Programmatically Lighten or Darken a hex color (or rgb, and blend colors).
Requirements
Install
$ npm install vue-cbsc --save
$ yarn add vue-cbsc
Configuration
import Vue from 'vue';
import VueCBSC from 'vue-cbsc';
Vue.use(VueCBSC);
Usage
new Vue({
el: '#app',
mounted: function() {
let color1 = 'rgb(114,93,20)';
let color2 = 'rgb(114,93,20,0.37423)';
let color3 = '#67DAF0';
let color4 = '#5567DAF0';
let color5 = '#F3A';
let color6 = '#DF3A';
let color7 = 'rgb(75,200,112)';
let color8 = 'rgb(75,200,112,0.98631)';
console.log(this.$cbsc.lighten(color1, 0.3));
console.log(this.$cbsc.darken(color5, 0.13));
console.log(this.$cbsc.blend(color2, 'c', 0.42));
console.log(this.$cbsc.convert(color6));
console.log(this.$cbsc.blend(color2, color8, -0.13));
console.log(this.$cbsc.blend(color2, color7, 0.65));
console.log(this.$cbsc.blend(color1, color3, 0.3));
console.log(this.$cbsc.blend(color4, color2, -0.13));
console.log(this.$cbsc.lighten('#FFBAA', 0.3));
console.log(this.$cbsc.blend(color1, color5, 30));
console.log(this.$cbsc.lighten('#salt', 0.3));
console.log(this.$cbsc.rip(color4));
}
})
Contributing