This repository has been archived on 2022-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
hydrogen-web/postcss/color.js

15 lines
450 B
JavaScript
Raw Normal View History

const offColor = require("off-color").offColor;
module.exports.derive = function (value, operation, argument) {
switch (operation) {
case "darker": {
const newColorString = offColor(value).darken(argument / 100).hex();
return newColorString;
}
case "lighter": {
const newColorString = offColor(value).lighten(argument / 100).hex();
return newColorString;
}
}
}