helper method to decide for the correct color

@param ctx
@return
966824
protected int getSelectedTextColor(Context ctx) {
        return ColorHolder.color(getSelectedTextColor(), ctx, R.attr.material_drawer_selected_text, R.color.material_drawer_selected_text);
    }
1129725
public static Drawable decideIcon(ImageHolder imageHolder, Context ctx, int iconColor, boolean tint) {
        if (imageHolder == null) {
            return null;
        } else {
            return imageHolder.decideIcon(ctx, iconColor, tint);
        }
    }
293384
protected int getColor(Context ctx) {
        int color;
        if (this.isEnabled()) {
            color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_primary_text, R.color.material_drawer_primary_text);
        } else {
            color = ColorHolder.color(getDisabledTextColor(), ctx, R.attr.material_drawer_hint_text, R.color.material_drawer_hint_text);
        }
        return color;
    }
373339
public void setChromeShadowColor(int color) {
    if (chromeShadowColor != color) {
      viewBorderPaint.setShadowLayer(1, -1, 1, color);
      chromeShadowColor = color;
      invalidate();
    }
  }
1205727
private Color buildWebColor(final WebColor wColor) {
        Color color = null;
        if (wColor.opacity() >= 1.0) {
            color = Color.web(HEXA_PREFIX + wColor.hex());
        } else {
            color = Color.web(HEXA_PREFIX + wColor.hex(), wColor.opacity());
        }
        return color;
    }
975640
public static boolean getBooleanStyleable(Context ctx, @StyleableRes int styleable, boolean def) {
        TypedArray ta = ctx.getTheme().obtainStyledAttributes(R.styleable.MaterialDrawer);
        return ta.getBoolean(styleable, def);
    }
62508
@Pure
	public static int getSelectionColor() {
		final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
		if (prefs != null) {
			final String str = prefs.get("SELECTION_COLOR", null); //$NON-NLS-1$
			if (str != null) {
				try {
					return Integer.valueOf(str);
				} catch (Throwable exception) {
					//
				}
			}
		}
		return DEFAULT_SELECTION_COLOR;
	}
141981
function( t ){
            var idx;
            if( this.colors.size() > 2 ){
                idx = Math.floor( this.map.getClippedValueFor(t) + 0.5 );
            } else {
                idx = t >= this.map.getInputMedian() ? 1 : 0;
            }
            return this.colors.get(idx);
        }
901637
public static int getDeclinedColorFromColor(int color) {
        int bg = 0xffffffff;
        int a = DECLINED_EVENT_ALPHA;
        int r = (((color & 0x00ff0000) * a) + ((bg & 0x00ff0000) * (0xff - a))) & 0xff000000;
        int g = (((color & 0x0000ff00) * a) + ((bg & 0x0000ff00) * (0xff - a))) & 0x00ff0000;
        int b = (((color & 0x000000ff) * a) + ((bg & 0x000000ff) * (0xff - a))) & 0x0000ff00;
        return (0xff000000) | ((r | g | b) >> 8);
    }
368224
private static String getHexSingle(String hex, int colorIndex) {
		validateHex(hex);

		if (hex.startsWith("#")) {
			hex = hex.substring(1);
		}

		int colorCharacters = 1;
		int numColors = hex.length();
		if (numColors > 4) {
			colorCharacters++;
			numColors /= 2;
		}

		String color = null;
		if (colorIndex >= 0 || numColors > 3) {
			if (numColors > 3) {
				colorIndex++;
			}
			int startIndex = colorIndex;
			if (colorCharacters > 1) {
				startIndex *= 2;
			}
			color = hex.substring(startIndex, startIndex + colorCharacters);
			color = expandShorthandHexSingle(color);
		}

		return color;
	}
929518
@Nullable
  public CSSStyleRule getStyleRuleAtIndex (@Nonnegative final int nIndex)
  {
    return m_aRules.getAtIndexMapped (r -> r instanceof CSSStyleRule, nIndex, r -> (CSSStyleRule) r);
  }
705479
@Pure
	public static int getPreferredRoadInternColor() {
		final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
		if (prefs != null) {
			final String color = prefs.get("ROAD_INTERN_COLOR", null); //$NON-NLS-1$
			if (color != null) {
				try {
					return Integer.valueOf(color);
				} catch (Throwable exception) {
					//
				}
			}
		}
		return DEFAULT_ROAD_INTERN_COLOR;
	}
84433
function(ctx) {
    assert(this.args.length == 3);
    if (this.args[0].evaluate(ctx).booleanValue()) {
      return this.args[1].evaluate(ctx);
    } else {
      return this.args[2].evaluate(ctx);
    }
  }
596635
public Color getCommonArrowColors(CommonControlState type) {
        switch (type) {

        case DISABLED:
            return arrowDisabled;

        case ENABLED:
        case PRESSED:
            return arrowEnabled;
        }

        return null;
    }
1086483
private int getColor(int value) {
		if (value == 0) {
			return 0;
		}

		double scale = Math.log10(value) / Math.log10(this.topValue);
		double lengthScale = Math.min(1.0, scale) * (colors.length - 1);
		int index = 1 + (int) lengthScale;
		if (index == colors.length) {
			index--;
		}
		double partScale = lengthScale - (index - 1);

		int r = (int) (colors[index - 1][0] + partScale
				* (colors[index][0] - colors[index - 1][0]));
		int g = (int) (colors[index - 1][1] + partScale
				* (colors[index][1] - colors[index - 1][1]));
		int b = (int) (colors[index - 1][2] + partScale
				* (colors[index][2] - colors[index - 1][2]));

		r = Math.min(255, r);
		b = Math.min(255, b);
		g = Math.min(255, g);
		return (r << 16) | (g << 8) | b;
	}
1147263
public static int color(ColorHolder colorHolder, Context ctx, @AttrRes int colorStyle, @ColorRes int colorDefault) {
        if (colorHolder == null) {
            return UIUtils.getThemeColorFromAttrOrRes(ctx, colorStyle, colorDefault);
        } else {
            return colorHolder.color(ctx, colorStyle, colorDefault);
        }
    }
22787
public static int getThemeColor(Context ctx, @AttrRes int attr) {
        TypedValue tv = new TypedValue();
        if (ctx.getTheme().resolveAttribute(attr, tv, true)) {
            return tv.resourceId != 0 ? ContextCompat.getColor(ctx, tv.resourceId) : tv.data;
        }
        return 0;
    }