¿Por qué el valor de X no llega hasta el borde del diseño?

paleta2 dibujable que se utiliza como fondo:

e al cuadrado dibujable (redimensionado usando@dimen y usado como pulgar):

XML:

<LinearLayout
                android:id="@+id/llColorSpect"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:layout_alignParentBottom="true" >
                <RelativeLayout
                    android:id="@+id/rlColorSpect"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/palette2" >
                    <ImageView
                        android:id="@+id/ivSquare"
                        android:layout_width="@dimen/title_text_pad"
                        android:layout_height="@dimen/title_text_pad"
                        android:layout_alignParentBottom="true"
                        android:scaleType="fitXY"
                        android:src="@drawable/esquare" />
                </RelativeLayout>
            </LinearLayout>

Java:

llColors = (RelativeLayout) findViewById(R.id.rlColorSpect);
        llColors.setOnTouchListener(llTouch);

        bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.palette2);

        llColors.setBackground(getResources().getDrawable(R.drawable.palette2));

        w = bitmap.getWidth();
        h = bitmap.getHeight();

        Log.i("PALETTE WIDTH", "width" +w);
        Log.i("PALETTE HEIGHT", "height" +h);

        observer = llColors.getViewTreeObserver();
        observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                width = llColors.getWidth();
                height = llColors.getHeight();

                Log.i("LAYOUT WIDTH", "width" +width);
                Log.i("LAYOUT HEIGHT", "height" +height);
                //in here, place the code that requires you to know the dimensions.
                //Place your code here
            }
        });

View.OnTouchListener llTouch = new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            x = (int)event.getX();
            y = (int)event.getY();
            if (x<0) {
                ivTouch.setX(0);
                ivTouch.setY(y);
                x=0;
                Toast.makeText(getApplicationContext(), "x=0", 2000).show();
            }
            if (y<0) {
                ivTouch.setY(0);
                ivTouch.setX(x);
                y=0;
                Toast.makeText(getApplicationContext(), "y=0", 2000).show();
            }
            if (x>bitmap.getWidth()) {
                ivTouch.setX(bitmap.getWidth());
                x=bitmap.getWidth()-1;
                Toast.makeText(getApplicationContext(), "x=bitmap.maxwidth(}", 2000).show();
            }
            if (y>bitmap.getHeight()) {
                ivTouch.setY(bitmap.getHeight());
                y=bitmap.getHeight()-20;
                Toast.makeText(getApplicationContext(), "y=bitmap.maxheight(}", 2000).show();
            }
            if (x>0 && x<bitmap.getWidth() || y>0 || y<bitmap.getHeight()) {
                int action = event.getAction();
                int pixel = bitmap.getPixel((int)x,(int) y);

                switch (action & MotionEvent.ACTION_MASK) {
                    case MotionEvent.ACTION_DOWN: {
                        Log.i("COORDINATES","Touch coordinates : x" + String.valueOf(x) + "y" + String.valueOf(y));
                        ivTouch.setX(x);
                        ivTouch.setY(y);
                        inRed = Color.red(pixel);
                        inBlue = Color.blue(pixel);
                        inGreen = Color.green(pixel);
                        Log.d("Colors","R:" +inRed +" G:" +inGreen+" B:" + inBlue);
                        dispHVal(inRed, inGreen, inBlue);
                        hexToRGB();
                        break;
                    }
                    case MotionEvent.ACTION_MOVE:{
                        Log.i("COORDINATES","Touch coordinates : x" + String.valueOf(x) + "y" + String.valueOf(y));
                        ivTouch.setX(x);
                        ivTouch.setY(y);
                        inRed = Color.red(pixel);
                        inBlue = Color.blue(pixel);
                        inGreen = Color.green(pixel);
                        Log.d("Colors","R:" +inRed +" G:" +inGreen+" B:" + inBlue);
                        dispHVal(inRed, inGreen, inBlue);
                        hexToRGB();
                        break;
                    }
                }
            }
            return true;
        }
    };

El LogCat muestra lo siguiente:

01-31 22:55:38.729: I/LAYOUT WIDTH(23021): width660
01-31 22:55:38.729: I/LAYOUT HEIGHT(23021): height470
01-31 22:55:38.744: I/COORDINATES(23021): Touch coordinates : x579y89
01-31 22:55:38.744: D/Colors(23021): R:226 G:226 B:226
01-31 22:55:38.760: I/LAYOUT WIDTH(23021): width660
01-31 22:55:38.760: I/LAYOUT HEIGHT(23021): height470

¿Alguien sabe por qué solo puedo arrastrar hasta 579 (la x solo sube hasta 579), mientras que el ancho del diseño es 660 y cómo lo arreglo?

EDITAR: Lo que estoy buscando hacer es permitir al usuario arrastrar a cualquier lugar dentro delRelativeLayout y donde el usuario arrastra, el pulgar se mueve con el dedo pero permanece dentro del diseño. Quiero poder recuperar el fondo como mapa de bits para poder convertir a valores RGB. ¿Cómo logro eso?

Respuestas a la pregunta(1)

Su respuesta a la pregunta