How to use the color/known-colors.isKnownName function in color

To help you get started, we’ve selected a few color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bradyhouse / house / fiddles / nativeScript / fiddle-0001-PageNavigation / pagenavigation / platforms / android / build / intermediates / assets / F0 / debug / app / tns_modules / color / color-common.js View on Github external
Color.isValid = function (value) {
        if (types.isNullOrUndefined(value) || value instanceof Color) {
            return true;
        }
        if (!types.isString(value)) {
            return false;
        }
        if (knownColors.isKnownName(value)) {
            return true;
        }
        return HEX_REGEX.test(value) || isRgbOrRgba(value);
    };
    Color.prototype._buildHex = function () {
github NickIliev / NativeScript-Firebase-Auth / firebaseAuth / platforms / android / build / intermediates / assets / F0F1 / debug / app / tns_modules / color / color-common.js View on Github external
Color.isValid = function (value) {
        if (types.isNullOrUndefined(value) || value instanceof Color) {
            return true;
        }
        if (!types.isString(value)) {
            return false;
        }
        if (knownColors.isKnownName(value)) {
            return true;
        }
        return HEX_REGEX.test(value) || isRgbOrRgba(value);
    };
    Color.prototype._buildHex = function () {
github bradyhouse / house / fiddles / nativeScript / fiddle-0009-SqliteDb / fifteenpuzzle / platforms / android / src / main / assets / app / tns_modules / color / color-common.js View on Github external
Color.isValid = function (value) {
        if (types.isNullOrUndefined(value) || value instanceof Color) {
            return true;
        }
        if (!types.isString(value)) {
            return false;
        }
        if (knownColors.isKnownName(value)) {
            return true;
        }
        return HEX_REGEX.test(value) || isRgbOrRgba(value);
    };
    Color.prototype._buildHex = function () {
github NativeScript / nativescript-app-templates / packages / template-hello-world / tns_modules / color / color-common.js View on Github external
function Color() {
        if (arguments.length === 1) {
            var arg = arguments[0];
            if (types.isString(arg)) {
                if (knownColors.isKnownName(arg)) {
                    this._hex = knownColors.getKnownColor(arg);
                    this._name = arg;
                }
                else {
                    this._hex = this._normalizeHex(arg);
                }
                this._argb = this._argbFromString(this._hex);
            }
            else if (types.isNumber(arg)) {
                this._argb = arg;
            }
            else {
                throw new Error("Expected 1 or 4 constructor parameters.");
            }
            this._parseComponents();
            if (!this._hex) {
github bradyhouse / house / fiddles / nativeScript / fiddle-0009-SqliteDb / fifteenpuzzle / platforms / android / src / main / assets / app / tns_modules / color / color-common.js View on Github external
function Color() {
        if (arguments.length === 1) {
            var arg = arguments[0];
            if (types.isString(arg)) {
                if (isRgbOrRgba(arg)) {
                    this._argb = argbFromRgbOrRgba(arg);
                }
                else if (knownColors.isKnownName(arg)) {
                    this._hex = knownColors.getKnownColor(arg);
                    this._name = arg;
                    this._argb = this._argbFromString(this._hex);
                }
                else {
                    this._hex = this._normalizeHex(arg);
                    this._argb = this._argbFromString(this._hex);
                }
            }
            else if (types.isNumber(arg)) {
                this._argb = arg;
            }
            else {
                throw new Error("Expected 1 or 4 constructor parameters.");
            }
            this._parseComponents();
github bradyhouse / house / fiddles / nativeScript / fiddle-0001-PageNavigation / pagenavigation / platforms / android / build / intermediates / assets / F0 / debug / app / tns_modules / color / color-common.js View on Github external
function Color() {
        if (arguments.length === 1) {
            var arg = arguments[0];
            if (types.isString(arg)) {
                if (isRgbOrRgba(arg)) {
                    this._argb = argbFromRgbOrRgba(arg);
                }
                else if (knownColors.isKnownName(arg)) {
                    this._hex = knownColors.getKnownColor(arg);
                    this._name = arg;
                    this._argb = this._argbFromString(this._hex);
                }
                else {
                    this._hex = this._normalizeHex(arg);
                    this._argb = this._argbFromString(this._hex);
                }
            }
            else if (types.isNumber(arg)) {
                this._argb = arg;
            }
            else {
                throw new Error("Expected 1 or 4 constructor parameters.");
            }
            this._parseComponents();
github NickIliev / NativeScript-Firebase-Auth / firebaseAuth / platforms / android / build / intermediates / assets / F0F1 / debug / app / tns_modules / color / color-common.js View on Github external
function Color() {
        if (arguments.length === 1) {
            var arg = arguments[0];
            if (types.isString(arg)) {
                if (isRgbOrRgba(arg)) {
                    this._argb = argbFromRgbOrRgba(arg);
                }
                else if (knownColors.isKnownName(arg)) {
                    this._hex = knownColors.getKnownColor(arg);
                    this._name = arg;
                    this._argb = this._argbFromString(this._hex);
                }
                else {
                    this._hex = this._normalizeHex(arg);
                    this._argb = this._argbFromString(this._hex);
                }
            }
            else if (types.isNumber(arg)) {
                this._argb = arg;
            }
            else {
                throw new Error("Expected 1 or 4 constructor parameters.");
            }
            this._parseComponents();