@wordpress/components
Version:
UI components for WordPress.
48 lines (42 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.colorsUtils = void 0;
var _i18n = require("@wordpress/i18n");
/**
* WordPress dependencies
*/
const gradients = {
linear: 'linear-gradient',
radial: 'radial-gradient'
};
const gradientOptions = [{
label: (0, _i18n.__)('Linear'),
value: gradients.linear
}, {
label: (0, _i18n.__)('Radial'),
value: gradients.radial
}];
const getGradientType = color => {
if (color !== null && color !== void 0 && color.includes(gradients.radial)) {
return gradients.radial;
} else if (color !== null && color !== void 0 && color.includes(gradients.linear)) {
return gradients.linear;
}
return false;
};
const colorsUtils = {
screens: {
gradientPicker: 'GradientPicker',
picker: 'Picker',
palette: 'Palette'
},
segments: [(0, _i18n.__)('Solid'), (0, _i18n.__)('Gradient')],
gradients,
gradientOptions,
getGradientType,
isGradient: color => !!getGradientType(color)
};
exports.colorsUtils = colorsUtils;
//# sourceMappingURL=utils.native.js.map