Set foreground color in FrameLayout in Android programmatically

android, colors, foreground

Solution

You can create a `Drawable` from color:

final int color = 0xFFFF0000;
final Drawable drawable = new ColorDrawable(color);

Problem

I want to set foreground color in FrameLayout programmatically (not in XML attribute). I have the color codes in `RGB` How can I convert color to drawable: ``` frm.setForeground(Drawable); ```

Original source