Drawable ResourcesのShapeをJavaで動的に作る方法がわからない

たとえば、

<!-- drawable/shape.xml -->
<?xml version="1.0" encoding="utf-8"?>
<shape
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:shape="rectangle">
	
	<solid android:color="<color>" />
	
	<corners
		android:topLeftRadius="5dp"
		android:topRightRadius="5dp"
		android:bottomLeftRadius="5dp"
		android:bottomRightRadius="5dp" />
</shape>
<TextView 
	android:id="@+id/set_shape"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:background="@drawable/shape" />

などとするときに、TextViewの背景色(solidタグのcolor属性)を状況によって変えたい場合。
Colorについては#ff0000とかで複数用意すればいいんだけど、その用意したColor Resourcesをsolidに適用する方法がわからない。上のXMLでTextViewにsetBackgroundColorは試してみたけど、shapeの指定を上書きしてしまってcornersの指定がなかった事にされてしまう。

http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape
Shapeと関わりがあるっぽいクラスにShapeDrawableクラスというものがあるんだけど、solidを動的に指定できそうなメソッドは見当たらない…。ついでに言うとcorners指定のメソッドもない?

Resources r = getResources();
TextView tv = (TextView) findViewById(R.id.set_shape);
ShapeDrawable sd = (ShapeDrawable) r.getDrawable(R.drawable.shape);
sd.setSolidColor(r.getColor(R.color.red)); //こういうメソッドがあってほしかった
tv.setBackgroundDrawable(sd)

みたいに出来たら一番ベストなんだけれど。setShapeとかPaintとかで色を持ってくるのかなあ。