Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/amasty/shopby/view/base/web/js/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/amasty/shopby/view/base/web/js/utils/color.js
/**
 * Amasty Shopby helpers
 */

define([
    'jquery',
    'jquery-ui-modules/effect'
], function ($) {
    'use strict';

    return {
        color_constants: {
            gradient: 0.675,
            shadow: 0.8,
            hover: 0.45
        },

        /**
         * Generate gradient color depending on the specified percentage
         *
         * @param {String} color - default
         * @param {String} type - type of gradient
         *
         * @return {String} new gradient color
         */ // eslint-disable-next-line consistent-return
        getGradient: function (color, type) {
            var lightenColor = this._getLightness(color, this.color_constants.gradient);

            if (type === 'vertical') {
                return 'linear-gradient(160deg, ' + lightenColor + '40%, ' + color + ' 100%)';
            }

            if (type === 'horizontal') {
                return 'linear-gradient(270deg,' + color + ' 0%, ' + lightenColor + ' 100%)';
            }
        },

        /**
         * Generate Box Shadow depending on the specified percentage
         *
         * @param {String} color - default
         *
         * @return {String} new box shadow
         */
        getShadow: function (color) {
            var shadowColor = this._getLightness(color, this.color_constants.shadow);

            return '0 3px 4px ' + shadowColor;
        },

        /**
         * Generate Hover color depending on the specified percentage
         *
         * @param {String} color - default
         * @param {Number} [percent] - default
         *
         * @return {String} new color
         */
        getHover: function (color, percent) {
            // eslint-disable-next-line no-param-reassign
            percent = percent || this.color_constants.hover;

            return this._getLightness(color, percent);
        },

        /**
         * Generate lightness color depending on the specified percentage
         *
         * @param {String} color - default
         * @param {Number} percent - default
         *
         * @return {String} new color
         */
        _getLightness: function (color, percent) {
            return $.Color(color).lightness(percent).toRgbaString();
        }
    };
});

Spamworldpro Mini