Add color inline CSS.

@see   $this->enqueue_colors_inline_css()
@since 1.0.0

@param string $name
@param array  $args
763059
public function add_color_inline_css( $name, array $args ) {

		if ( empty( $name ) || empty( $args['css'] ) ) {

			return;

		}

		$default = $this->get_default_color( $name, 'default' );
		$hex     = trim( get_theme_mod( $name, $default ), '#' );
		$css     = sprintf( Rock_Customizer::parse_css_rules( $args['css'] ), '#' . $hex );

		if ( ! empty( $args['rgba_css'] ) ) {

			$css .= sprintf(
				Rock_Customizer::parse_css_rules( $args['rgba_css'] ),
				implode( ', ', rock_hex2rgb( $hex ) )
			);

		}

		wp_add_inline_style( Rock_Customizer::$stylesheet, $css );

	}
1285450
public function materialDesignColorPaletteBackgroundFunction(array $args = []) {
        return $this->materialDesignColorPalette("bg", ArrayHelper::get($args, "name"), ArrayHelper::get($args, "value"));
    }
1222865
protected function _parseFunction($name, $args)
    {
        $res = '';
        switch ($name) {
            case 'if':
                $res = 'if('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                array_push($this->_blockStack, 'if');
                break;

            case 'else':
                if (substr(end($this->_blockStack), 0, 2) != 'if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $res = 'else:';
                }
                break;

            case 'elseif':
                if (end($this->_blockStack) != 'if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $res = 'elseif('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                }
                break;

            case 'foreach':
                if ($this->trusted) {
                    $notallowed = array(';','!');
                } else {
                    $notallowed = array(';','!','(');
                }

                if (preg_match("/^\s*\((.*)\)\s*$/", $args, $m)) {
                    $args = $m[1];
                }

                $res = 'foreach('.$this->_parseFinal($args, $this->_allowedInForeach, $notallowed).'):';
                array_push($this->_blockStack, 'foreach');
                break;

            case 'while':
                $res = 'while('.$this->_parseFinal($args, $this->_allowedInExpr).'):';
                array_push($this->_blockStack, 'while');
                break;

            case 'for':
                if ($this->trusted) {
                    $notallowed = array();
                } else {
                    $notallowed = array('(');
                }
                if (preg_match("/^\s*\((.*)\)\s*$/", $args, $m)) {
                    $args = $m[1];
                }
                $res = 'for('.$this->_parseFinal($args, $this->_allowedInExpr, $notallowed).'):';
                array_push($this->_blockStack, 'for');
                break;

            case '/foreach':
            case '/for':
            case '/if':
            case '/while':
                $short = substr($name, 1);
                if (end($this->_blockStack) != $short) {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    array_pop($this->_blockStack);
                    $res = 'end'.$short.';';
                }
                break;

            case 'assign':
            case 'eval':
                $res = $this->_parseFinal($args, $this->_allowedAssign).';';
                break;

            case 'literal':
                if (count($this->_literals)) {
                    $res = '?>'.array_shift($this->_literals).'<?php ';
                } else {
                    $this->doError1('errors.tpl.tag.block.end.missing', 'literal');
                }
                break;

            case '/literal':
                $this->doError1('errors.tpl.tag.block.begin.missing', 'literal');
                break;

            case 'meta':
                $this->_parseMeta($args);
                break;

            case 'meta_if':
                $metaIfArgs = $this->_parseFinal($args, $this->_allowedInExpr);
                $this->_metaBody .= 'if('.$metaIfArgs.'):'."\n";
                array_push($this->_blockStack, 'meta_if');
                break;

            case 'meta_else':
                if (substr(end($this->_blockStack), 0, 7) != 'meta_if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $this->_metaBody .= "else:\n";
                }
                break;

            case 'meta_elseif':
                if (end($this->_blockStack) != 'meta_if') {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    $elseIfArgs = $this->_parseFinal($args, $this->_allowedInExpr);
                    $this->_metaBody .= 'elseif('.$elseIfArgs."):\n";
                }
                break;

            case '/meta_if':
                $short = substr($name, 1);
                if (end($this->_blockStack) != $short) {
                    $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                } else {
                    array_pop($this->_blockStack);
                    $this->_metaBody .= "endif;\n";
                }
                break;

            default:
                if (preg_match('!^/(\w+)$!', $name, $m)) {
                    if (end($this->_blockStack) != $m[1]) {
                        $this->doError1('errors.tpl.tag.block.end.missing', end($this->_blockStack));
                    } else {
                        array_pop($this->_blockStack);
                        if (function_exists($fct = 'jtpl_block_'.$this->outputType.'_'.$m[1])) {
                            $res = $fct($this, false, null);
                        } elseif (function_exists($fct = 'jtpl_block_common_'.$m[1])) {
                            $res = $fct($this, false, null);
                        } else {
                            $this->doError1('errors.tpl.tag.block.begin.missing', $m[1]);
                        }
                    }
                } elseif (preg_match('/^meta_(\w+)$/', $name, $m)) {
                    if ($path = $this->_getPlugin('meta', $m[1])) {
                        $this->_parseMeta($args, $path[1]);
                        $this->_pluginPath[$path[0]] = true;
                    } else {
                        $this->doError1('errors.tpl.tag.meta.unknown', $m[1]);
                    }
                    $res = '';
                } elseif ($path = $this->_getPlugin('block', $name)) {
                    require_once $path[0];
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign, array(';'), true);
                    $fct = $path[1];
                    $res = $fct($this, true, $argfct);
                    array_push($this->_blockStack, $name);
                } elseif ($path = $this->_getPlugin('cfunction', $name)) {
                    require_once $path[0];
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign, array(';'), true);
                    $fct = $path[1];
                    $res = $fct($this, $argfct);
                } elseif ($path = $this->_getPlugin('function', $name)) {
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign);
                    $res = $path[1].'( $t'.(trim($argfct) != '' ? ','.$argfct : '').');';
                    $this->_pluginPath[$path[0]] = true;
                } elseif (isset($this->_userFunctions[$name])) {
                    $argfct = $this->_parseFinal($args, $this->_allowedAssign);
                    $res = $this->_userFunctions[$name].'( $t'.(trim($argfct) != '' ? ','.$argfct : '').');';
                } else {
                    $this->doError1('errors.tpl.tag.function.unknown', $name);
                }
        }

        return $res;
    }
522361
public function addCss($name, $attributes = [])
    {
        if (is_array($name)) {
            $name = $this->combineAssets($name, $this->getLocalPath($this->assetPath));
        }

        $cssPath = $this->getAssetPath($name);

        if (isset($this->controller)) {
            $this->controller->addCss($cssPath, $attributes);
        }

        if (is_string($attributes)) {
            $attributes = ['build' => $attributes];
        }

        $cssPath = $this->getAssetScheme($cssPath);

        if (!in_array($cssPath, $this->assets['css'])) {
            $this->assets['css'][] = ['path' => $cssPath, 'attributes' => $attributes];
        }
    }
334678
protected function colorArgs($args)
    {
        if ($args[0] != 'list' || count($args[2]) < 2) {
            return array(array('color', 0, 0, 0), 0);
        }
        list($color, $delta) = $args[2];
        $color = $this->assertColor($color);
        $delta = floatval($delta[1]);

        return array($color, $delta);
    }
901375
protected static function convertProperty($name, array $args = [])
    {
        if ($name === 'text') {
            return 'text()';
        }

        if ($name === 'attr') {
            if (count($args) === 0) {
                return '@*';
            }

            $attributes = [];

            foreach ($args as $attribute) {
                $attributes[] = sprintf('name() = "%s"', $attribute);
            }

            return sprintf('@*[%s]', implode(' or ', $attributes));
        }

        throw new InvalidSelectorException(sprintf('Unknown property "%s"', $name));
    }
490203
public function getCommand($name, array $args = array()) {
    /*if($name != 'oauth') {
		  $this->checkAuth();
    }*/

    $command = parent::getCommand($name, $args);
    $this->command_history[] = $command;
		return $command;
	}
1290764
public function addTaxonomy($name, $args = [])
    {
        $taxonomy = new Taxonomy($name, $this->name, $args);

        return $this;
    }
642309
public void add(String name, MessageArg arg) {
    args.add(arg);
    if (map == null) {
      map = new HashMap<>();
    }
    map.put(name, arg);
  }
1252701
public function render_module_template( string $name, array $args ) {
		if ( ! apply_filters( 'hogan/module/' . $name . '/show_in_rest', true ) && \hogan_is_rest() ) {
			return;
		}

		// Get the right module.
		$module = $this->get_module( $name );

		if ( $module instanceof Module ) {
			$module->render_template( $args, $this->_module_counter );
			$this->_module_counter++;
		}
	}
326356
public function getColor($name, $default = null)
    {
        $this->arguments[] = '--get-color';
        $this->arguments[] = $name;
        if ($default !== null) {
            $this->arguments[] = $default;
        }
        return $this;
    }
1348578
protected function cutArgument($name, &$args)
    {
        if (isset($args[$name])) {
            $result = $args[$name];
            unset($args[$name]);
            return $result;
        }

        return null;
    }
1226867
public function render($name, array $args = array())
    {
        if ($this->has($name)) {
            $callback = $this->widgets[$name];

            return $this->executeCallback($callback, $args);
        }

        return '';
    }
889826
protected function buildTerminalObject($name, $arguments)
    {
        // Retrieve the parser for the current set of styles
        $parser = $this->style->parser($this->util->system);

        // Reset the styles
        $this->style->reset();

        // Execute the terminal object
        $this->router->settings($this->settings);
        $this->router->parser($parser);
        $this->router->output($this->output);
        $this->router->util($this->util);

        return $this->router->execute($name, $arguments);
    }
487043
public function routeNameToUrlString($name, array $args = [])
    {
        foreach ($args as $offset => $arg) {
            if ( !$arg ) {
                unset($args[ $offset ]);
            }
        }

        try {
            $url = $this->generate($name, $args);
        } catch (RouteNotFound $exception) {
            try {
                $newName = 'default.' . $name;
                $url     = $this->generate($newName, $args);
            } catch (RouteNotFound $e) {
                throw new RouteNotFound(sprintf('Route with name "%s" or "%s" not found', $newName, $name));
            }
        }

        if ( FALSE !== strstr($url, '{') ) {
            throw new RouteNotFound(
                sprintf('Route with name "%s" needs parameters. Temporary resulted into: %s', $name, $url)
            );
        }

        return $this->request->getBaseUrl() . $url;
    }
1084799
public function color($name, array $options = []): FieldTypeInterface
    {
        return (new ColorType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
676024
public function runMacro($name, $args)
    {
        if (isset($this->macros[$name])) {
            if (is_callable($this->macros[$name])) {
                return call_user_func_array($this->macros[$name], array_merge([$this], $args));
            }
        }
    }