public void setPenColorRes(int colorRes) {
        try {
            setPenColor(getResources().getColor(colorRes));
        } catch (Resources.NotFoundException ex) {
            setPenColor(Color.parseColor("#000000"));
        }
    }
Set the pen color from a given resource.
If the resource is not found, {@link android.graphics.Color#BLACK} is assumed.

@param colorRes the color resource.
signature-pad/src/main/java/com/github/gcacace/signaturepad/views/SignaturePad.java