You can chage the color programmatically, you should put your code inside :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke android:width="2dp" android:color="@color/azul_oscuro"/>
<solid android:color="@color/azul_1" />
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<corners android:radius="1dp" />
</shape>
Then you can asing your shape to any item in a layout, for example a view:
<View
android:layout_width="56dp"
android:layout_height="40dp" android:background="@drawable/yourshapefilename" android:id="@+id/view_color"
android:enabled="false"/>
In your code when you inflate the layout you can change the color this way:
View myvie = findViewById(R.id.view_color);
GradientDrawable draw = (GradientDrawable)myvie.getBackground();
draw.setColor(getResources().getColor(R.color.rojo)); //--> change the solid color here
draw.setStroke(7, getResources().getColor(R.color.green)); // -->change stroke color and size