Your IP : 216.73.216.43


Current Path : /var/www/magento.test.indacotrentino.com/www/app/code/Amasty/Rewards/view/adminhtml/web/js/
Upload File :
Current File : /var/www/magento.test.indacotrentino.com/www/app/code/Amasty/Rewards/view/adminhtml/web/js/color.js

define([
    "jquery",
    "jquery/colorpicker/js/colorpicker"
], function ($) {
    'use strict';

    return function (config) {
        $(document).ready(function () {
            var input = $("#" + config.htmlId);

            function inverse(color) {
                return (0xFFFFFF - ("0x" + color)).toString(16).padStart(6, "0").toUpperCase();
            }

            if (config.inverseHex !== '') {
                input.css({"backgroundColor" : config.value, "color": config.inverseHex});
            }

            input.ColorPicker({
                color: "' . $value . '",
                onChange: function (hsb, hex) {
                    input.css({"backgroundColor": "#" + hex, "color": "#" + inverse(hex)}).val("#" + hex);
                }
            });
        });
    };
});