@vimeo/iris
Version:
Vimeo Design System
12 lines (9 loc) • 949 B
JavaScript
import { readableColor, parseToHsl, parseToRgb } from 'polished';
function colorLog(_a) {
var color = _a.color, grade = _a.grade, newColor = _a.newColor;
console.log({ color: color, grade: grade, newColor: newColor });
console.log("%c ".concat(newColor, " "), "background: ".concat(newColor, "; color: ").concat(readableColor(newColor)));
console.log("%c H ".concat(parseToHsl(newColor).hue.toFixed(2), " S ").concat(parseToHsl(newColor).saturation.toFixed(2), " L ").concat(parseToHsl(newColor).lightness.toFixed(2), " "), "background: ".concat(newColor, "; color: ").concat(readableColor(newColor)));
console.log("%c R ".concat(parseToRgb(newColor).red.toFixed(2), " G ").concat(parseToRgb(newColor).green.toFixed(2), " B ").concat(parseToRgb(newColor).blue.toFixed(2), " "), "background: ".concat(newColor, "; color: ").concat(readableColor(newColor)));
}
export { colorLog };