Apply a design to the style
@param design    the design, i.e. Holo, Material, Light, Dark
169474
@Override
    public void applyDesign(Design design, int themeColor) {
        Context ctx = mInputField.getContext();

        int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small;
        int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default_margin_small;

        int padLR = ctx.getResources().getDimensionPixelSize(largePadId);
        int padTB = ctx.getResources().getDimensionPixelSize(smallPadId);

        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        params.setMargins(padLR, padTB, padLR, padTB);
        mInputField.setLayoutParams(params);

        if(design.isLight())
            mInputField.setTextColor(mInputField.getResources().getColor(R.color.background_material_dark));
        else
            mInputField.setTextColor(mInputField.getResources().getColor(R.color.background_material_light));

        Drawable drawable;
        if(design.isMaterial()) {
            drawable = mInputField.getResources().getDrawable(R.drawable.edittext_mtrl_alpha);
        }else{
            drawable = mInputField.getBackground();
        }

        drawable.setColorFilter(themeColor, PorterDuff.Mode.SRC_ATOP);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
            mInputField.setBackground(drawable);
        else
            mInputField.setBackgroundDrawable(drawable);

    }
846603
function _applyAnyStylesheet(node) {
  if (!doc.createStyleSheet) {
    return;
  }

  if (_getHTMLNodeName(node) === 'style') {
    // IE
    var ss = doc.createStyleSheet(); // Create a stylesheet to actually do something useful

    ss.cssText = node.cssText; // We continue to add the style tag, however
  }
}
463075
private static void applyShapeStyle(Element element, ShapeStyle style) {
		// First check the presence of the fill and stroke elements:
		NodeList<Element> fills = element.getElementsByTagName("fill");
		if (fills.getLength() == 0) {
			Element stroke = Dom.createElementNS(Dom.NS_VML, "stroke");
			element.appendChild(stroke);
			Element fill = Dom.createElementNS(Dom.NS_VML, "fill");
			element.appendChild(fill);
			fills = element.getElementsByTagName("fill");
		}

		// Then if fill-color then filled=true:
		if (style.getFillColor() != null) {
			element.setAttribute("filled", "true");
			fills.getItem(0).setAttribute("color", style.getFillColor());
			fills.getItem(0).setAttribute("opacity", Float.toString(style.getFillOpacity()));
		} else {
			element.setAttribute("filled", "false");
		}

		// Then if stroke-color then stroke=true:
		if (style.getStrokeColor() != null) {
			element.setAttribute("stroked", "true");
			NodeList<Element> strokes = element.getElementsByTagName("stroke");
			strokes.getItem(0).setAttribute("color", style.getStrokeColor());
			strokes.getItem(0).setAttribute("opacity", Float.toString(style.getStrokeOpacity()));
			element.setAttribute("strokeweight", Float.toString(style.getStrokeWidth()));
		} else {
			element.setAttribute("stroked", "false");
		}
	}
1001328
public void setStyleClass(int from, int to, String styleClass) {
        setStyle(from, to, Collections.singletonList(styleClass));
    }
917588
public void add(T style)
    {
        Integer cnt = styles.get(style);
        if (cnt == null)
            styles.put(style, 1);
        else
            styles.put(style, cnt+1);
    }
767723
def apply(self, builder):
        """"""

        if 'theme' in self.attributes:
            builder.apply_theme(
                self.attributes['theme'],
                builder.theme_options,
            )
1152971
public void applyStyleToElement(Style style, JRDesignElement designElemen) {
        if (style == null) {
//			log.warn("NULL style passed to object");
            JRDesignStyle style_ = new JRDesignStyle();
            style_.setName(createUniqueStyleName());
            designElemen.setStyle(style_);
            try {
                getDesign().addStyle(style_);
            } catch (JRException e) {
                //duplicated style, its ok
            }
//			return null;
            return;
        }
        boolean existsInDesign = style.getName() != null
                && design.getStylesMap().get(style.getName()) != null;
        //		&& !style.isOverridesExistingStyle();

        JRDesignStyle jrstyle;
        //Let's allways add a new JR style
        if (existsInDesign && !style.isOverridesExistingStyle()) {
            jrstyle = (JRDesignStyle) design.getStylesMap().get(style.getName());
        } else {
            addStyleToDesign(style); //Order maters. This line fist
            jrstyle = style.transform();
        }

        designElemen.setStyle(jrstyle);
        if (designElemen instanceof JRDesignTextElement) {
            JRDesignTextElement textField = (JRDesignTextElement) designElemen;
            if (style.getStreching() != null)
                textField.setStretchType(StretchTypeEnum.getByValue(style.getStreching().getValue()));
            textField.setPositionType(PositionTypeEnum.FLOAT);

        }
        if (designElemen instanceof JRDesignTextField) {
            JRDesignTextField textField = (JRDesignTextField) designElemen;
            textField.setStretchWithOverflow(style.isStretchWithOverflow());

            if (!textField.isBlankWhenNull() && style.isBlankWhenNull()) //TODO Re check if this condition is ok
                textField.setBlankWhenNull(true);
        }

        if (designElemen instanceof JRDesignGraphicElement) {
            JRDesignGraphicElement graphicElement = (JRDesignGraphicElement) designElemen;
            graphicElement.setStretchType(StretchTypeEnum.getByValue(style.getStreching().getValue()));
            graphicElement.setPositionType(PositionTypeEnum.FLOAT);
        }
    }
757923
function _applyStyles(context, attrs) {
    for (var attr in attrs) {
      if (attrs.hasOwnProperty(attr)) {
        context.style[attr] = attrs[attr];
      }
    }
  }
354468
public boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureRow featureRow) {
        return StyleUtils.setFeatureStyle(polygonOptions, featureStyleExtension, featureRow, density);
    }
792706
public static void applyToOr(ColorHolder colorHolder, TextView textView, ColorStateList colorDefault) {
        if (colorHolder != null && textView != null) {
            colorHolder.applyToOr(textView, colorDefault);
        } else if (textView != null) {
            textView.setTextColor(colorDefault);
        }
    }
716290
public void setStyle(StyleRow styleRow, GeometryType geometryType) {
		if (geometryType != null) {
			if (styleRow != null) {
				styles.put(geometryType, styleRow);
			} else {
				styles.remove(geometryType);
			}
		} else {
			defaultStyle = styleRow;
		}
	}
746122
@Override
    public void readDesign(Element design, DesignContext designContext) {
        super.readDesign(design, designContext);
        Attributes attr = design.attributes();
        if (attr.hasKey("mime-type")) {
            MimeType mimeType = null;
            String mimeTypeString = DesignAttributeHandler.getFormatter().parse(
                     attr.get("mime-type"), String.class);
            try {
                mimeType = MimeType.valueOfMimeType(mimeTypeString);
            } catch (IllegalArgumentException e) {
                Logger.getLogger(SignatureField.class.getName()).info(
                        "Unsupported MIME-Type found when reading from design : "
                                .concat(mimeTypeString));
            }
            setMimeType(mimeType);
        }
    }
441512
public void setColor(Color c) {
		boolean renderAgain = (c != m_color) && isRendered();
		m_color = c;
		if (renderAgain)
			render(g2d);
	}
1263630
public void applyDefaults() {
		if (getName() == null) {
			setName(DEFAULT_NAME);
		}
		if (getFeatureStyles().size() == 0) {
			getFeatureStyles().add(new FeatureStyleInfo());
		}
		for (FeatureStyleInfo featureStyle : getFeatureStyles()) {
			featureStyle.applyDefaults();
		}
		if (getLabelStyle().getLabelAttributeName() == null) {
			getLabelStyle().setLabelAttributeName(LabelStyleInfo.ATTRIBUTE_NAME_ID);
		}
		getLabelStyle().getBackgroundStyle().applyDefaults();
		getLabelStyle().getFontStyle().applyDefaults();
	}
316492
public static void setDefaultTheme(int theme) {
        ThemeManager._DEFAULT_THEME = theme;
        if (theme < _START_RESOURCES_ID) {
            ThemeManager._DEFAULT_THEME &= ThemeManager._THEME_MASK;
        }
    }
142244
public static boolean setStyle(PolylineOptions polylineOptions, StyleRow style, float density) {

        if (style != null) {

            Color color = style.getColorOrDefault();
            polylineOptions.color(color.getColorWithAlpha());

            double width = style.getWidthOrDefault();
            polylineOptions.width((float) width * density);

        }

        return style != null;
    }
42642
def apply_style(*style_names)
      if style_names
        selected.each do |selected_view|
          style_names.each do |style_name|
            apply_style_to_view selected_view, style_name
          end
        end
      end
      self
    end