helper method to decide for the correct color

@param ctx
@return
775383
public int getIconColor(Context ctx) {
        int iconColor;
        if (this.isEnabled()) {
            iconColor = ColorHolder.color(getIconColor(), ctx, R.attr.material_drawer_primary_icon, R.color.material_drawer_primary_icon);
        } else {
            iconColor = ColorHolder.color(getDisabledIconColor(), ctx, R.attr.material_drawer_hint_icon, R.color.material_drawer_hint_icon);
        }
        return iconColor;
    }
1261768
@SuppressWarnings("deprecation")
    public static @ColorInt int resolveColor(@ColorRes int color, Context context) {
        if (Build.VERSION.SDK_INT >= 23) {
            return context.getResources().getColor(color, context.getTheme());
        }
        else {
            return context.getResources().getColor(color);
        }
    }
681497
public String selectColor(List<String> colors) {
        String tr="transparent";
        for (String c: colors) {
            if (!(c.equals(tr))) return c;
        }
        return tr;
    }
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;
    }
534700
public static Drawable getSelectableBackground(Context ctx) {
        int selectableBackgroundRes = getSelectableBackgroundRes(ctx);
        return ContextCompat.getDrawable(ctx, selectableBackgroundRes);
    }
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);
        }
    }
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;
    }
91179
def resolve_color_default(color=None):
    "
    if color is not None:
        return color
    ctx = get_current_context(silent=True)
    if ctx is not None:
        return ctx.color
1350161
protected int getSelectedIconColor(Context ctx) {
        return ColorHolder.color(getSelectedIconColor(), ctx, R.attr.material_drawer_selected_text, R.color.material_drawer_selected_text);
    }
24078
public static int getThemeColorFromAttrOrRes(Context ctx, int attr, int res) {
		int color = getThemeColor(ctx, attr);
		// If this color is not styled, use the default from the resource
		if (color == 0) {
			color = ContextCompat.getColor(ctx, res);
		}
		return color;
	}
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;
	}
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;
	}
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;
    }
397964
def color(cls, value):
        """"""
        index = bisect(cls.breakpoints, value)
        return colors.fg(cls.colors_[index])
798842
public String getValue(FaceletContext ctx)
    {
        if ((this.capabilities & EL_LITERAL) != 0)
        {
            return this.value;
        }
        else
        {
            return (String) this.getObject(ctx, String.class);
        }
    }
1032557
public Color getColor(int x, int y) {
	    
		if (pixelData == null) {
			pixelData = texture.getTextureData();
		}
		
		
		int xo = (int) (textureOffsetX * texture.getTextureWidth());
		int yo = (int) (textureOffsetY * texture.getTextureHeight());
		
		if (textureWidth < 0) {
			x = xo - x;
		} else {
			x = xo + x;
		} 
		
		if (textureHeight < 0) {
			y = yo - y;
		} else {
			y = yo + y;
		}
		
		// Clamp to texture dimensions
		x %= texture.getTextureWidth();
		y %= texture.getTextureHeight();

		int offset = x + (y * texture.getTextureWidth());
		offset *= texture.hasAlpha() ? 4 : 3;
		
		if (texture.hasAlpha()) {
			return new Color(translate(pixelData[offset]),translate(pixelData[offset+1]),
							 translate(pixelData[offset+2]),translate(pixelData[offset+3]));
		} else {
			return new Color(translate(pixelData[offset]),translate(pixelData[offset+1]),
					 	     translate(pixelData[offset+2]));
		}
	}
1111505
public GVRShader getTemplate(GVRContext ctx)
    {
        if (mShaderTemplate == null)
        {
            mShaderTemplate = makeTemplate(ID, ctx);
            ctx.getShaderManager().addShaderID(this);
        }
        return mShaderTemplate;
    }