Java Code Examples for gwt.material.design.client.base.helper.ColorHelper#setupComputedBackgroundColor()
The following examples show how to use
gwt.material.design.client.base.helper.ColorHelper#setupComputedBackgroundColor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JsCircularProgressOptions.java From gwt-material-addins with Apache License 2.0 | 5 votes |
@JsOverlay public static final JsCircularProgressOptions create() { JsCircularProgressOptions options = new JsCircularProgressOptions(); options.value = 0.0; options.size = 100; options.thickness = 8; options.startAngle = Math.PI; options.fill = ColorHelper.setupComputedBackgroundColor(Color.BLUE); options.emptyFill = ColorHelper.setupComputedBackgroundColor(Color.GREY_LIGHTEN_2); options.reverse = false; return options; }
Example 2
Source File: MaterialCutOut.java From gwt-material-addins with Apache License 2.0 | 5 votes |
/** * Gets the computed background color, based on the backgroundColor CSS * class. */ protected void setupComputedBackgroundColor() { // temp is just a widget created to evaluate the computed background // color MaterialWidget temp = new MaterialWidget(Document.get().createDivElement()); temp.setBackgroundColor(backgroundColor); // setting a style to make it invisible for the user Style style = temp.getElement().getStyle(); style.setPosition(Position.FIXED); style.setWidth(1, Unit.PX); style.setHeight(1, Unit.PX); style.setLeft(-10, Unit.PX); style.setTop(-10, Unit.PX); style.setZIndex(-10000); // adding it to the body (on Chrome the component must be added to the // DOM before getting computed values). String computed = ColorHelper.setupComputedBackgroundColor(backgroundColor); // convert rgb to rgba, considering the opacity field if (opacity < 1 && computed.startsWith("rgb(")) { computed = computed.replace("rgb(", "rgba(").replace(")", ", " + opacity + ")"); } computedBackgroundColor = computed; }
Example 3
Source File: MaterialCircularProgress.java From gwt-material-addins with Apache License 2.0 | 4 votes |
/** * Set the fillColor of the circular progress */ public void setFillColor(Color fillColor) { this.fillColor = fillColor; options.fill = ColorHelper.setupComputedBackgroundColor(fillColor); }
Example 4
Source File: MaterialCircularProgress.java From gwt-material-addins with Apache License 2.0 | 4 votes |
/** * Set the empty fill color of the circular progress */ public void setEmptyFillColor(Color emptyFillColor) { this.emptyFillColor = emptyFillColor; options.emptyFill = ColorHelper.setupComputedBackgroundColor(emptyFillColor); }
Example 5
Source File: MaterialBubble.java From gwt-material-addins with Apache License 2.0 | 4 votes |
@Override public void setBackgroundColor(Color bgColor) { super.setBackgroundColor(bgColor); options.color = ColorHelper.setupComputedBackgroundColor(bgColor); reload(); }