diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 91903c2..34f028c 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -40,4 +40,9 @@
         <attr name="previewBetweenText" format="string" />
     </declare-styleable>
 
+    <!-- Value to pass to callback when restore button is pressed -->
+    <declare-styleable name="ColorPreference">
+        <attr name="defaultColorValue" format="integer" />
+    </declare-styleable>
+
 </resources>
diff --git a/src/com/bliss/support/colorpicker/ColorPickerPreference.java b/src/com/bliss/support/colorpicker/ColorPickerPreference.java
index 17c3e31..01b0978 100644
--- a/src/com/bliss/support/colorpicker/ColorPickerPreference.java
+++ b/src/com/bliss/support/colorpicker/ColorPickerPreference.java
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2011 Sergey Margaritov
  * Copyright (C) 2013 Slimroms
+ * Copyright (C) 2015 The TeamEos Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +29,7 @@
 import android.support.v7.preference.*;
 import android.util.AttributeSet;
 import android.view.View;
+import android.view.ViewGroup.LayoutParams;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -49,6 +51,12 @@
     private float mDensity = 0;
     private boolean mAlphaSliderEnabled = false;
 
+    // if we return -6, button is not enabled
+    static final String SETTINGS_NS = "http://schemas.android.com/apk/res/com.android.settings";
+    static final int DEF_VALUE_DEFAULT = -6;
+    boolean mUsesDefaultButton = false;
+    int mDefValue = -1;
+
     private EditText mEditText;
 
     public ColorPickerPreference(Context context) {
@@ -81,6 +89,11 @@
         setOnPreferenceClickListener(this);
         if (attrs != null) {
             mAlphaSliderEnabled = attrs.getAttributeBooleanValue(null, "alphaSlider", false);
+            int defVal = attrs.getAttributeIntValue(SETTINGS_NS, "defaultColorValue", DEF_VALUE_DEFAULT);
+            if (defVal != DEF_VALUE_DEFAULT) {
+                mUsesDefaultButton =  true;
+                mDefValue = defVal;
+            }
         }
     }
 
@@ -92,9 +105,67 @@
         widgetFrameView = ((LinearLayout) view
                 .findViewById(android.R.id.widget_frame));
 
+        if (mUsesDefaultButton) {
+            setDefaultButton();
+        }
+
         setPreviewColor();
     }
 
+    /**
+     * Restore a default value, not necessarily a color
+     * For example: Set default value to -1 to remove a color filter
+     *
+     * @author Randall Rushing aka Bigrushdog
+     */
+    private void setDefaultButton() {
+        if (mView == null)
+            return;
+
+        LinearLayout widgetFrameView = ((LinearLayout) mView
+                .findViewById(android.R.id.widget_frame));
+        if (widgetFrameView == null)
+            return;
+
+        ImageView defView = new ImageView(getContext());
+        widgetFrameView.setOrientation(LinearLayout.HORIZONTAL);
+
+        // remove already created default button
+        int count = widgetFrameView.getChildCount();
+        if (count > 0) {
+            View oldView = widgetFrameView.findViewWithTag("default");
+            View spacer = widgetFrameView.findViewWithTag("spacer");
+            if (oldView != null) {
+                widgetFrameView.removeView(oldView);
+            }
+            if (spacer != null) {
+                widgetFrameView.removeView(spacer);
+            }
+        }
+
+        widgetFrameView.addView(defView);
+        widgetFrameView.setMinimumWidth(0);
+        defView.setBackground(getContext().getDrawable(android.R.drawable.ic_menu_revert));
+        defView.setTag("default");
+        defView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                try {
+                    getOnPreferenceChangeListener().onPreferenceChange(ColorPickerPreference.this,
+                            Integer.valueOf(mDefValue));
+                } catch (NullPointerException e) {
+                }
+            }
+        });
+
+        // sorcery for a linear layout ugh
+        View spacer = new View(getContext());
+        spacer.setTag("spacer");
+        spacer.setLayoutParams(new LinearLayout.LayoutParams((int) (mDensity * 16),
+                LayoutParams.MATCH_PARENT));
+        widgetFrameView.addView(spacer);
+    }
+
     private void setPreviewColor() {
         if (mView == null)
             return;
@@ -115,12 +186,22 @@
         // remove already create preview image
         int count = widgetFrameView.getChildCount();
         if (count > 0) {
-            widgetFrameView.removeViews(0, count);
+            View preview = widgetFrameView.findViewWithTag("preview");
+            if (preview != null) {
+                widgetFrameView.removeView(preview);
+            }
         }
         widgetFrameView.addView(iView);
         widgetFrameView.setMinimumWidth(0);
         iView.setBackgroundDrawable(new AlphaPatternDrawable((int) (5 * mDensity)));
         iView.setImageBitmap(getPreviewBitmap());
+        iView.setTag("preview");
+        iView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showDialog(null);
+            }
+        });
     }
 
     private Bitmap getPreviewBitmap() {
@@ -161,7 +242,7 @@
     }
 
     public boolean onPreferenceClick(Preference preference) {
-        showDialog(null);
+        //showDialog(null);
         return false;
     }
 
