EleshBaraiya / Live-Camera-Color-Picker

Live Camera Color Picker is an Android application that lets you capture, in real time, the colors around you using the camera of your device.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Live-Camera-Color-Picker

It is a very light weight library that uses the camera of your device to capture a color. It analyses in real time the camera preview and extracts the color that you are pointing at. You don't have to take a picture and then pinpoint the color you want: it all happens in real time.

repositories {	
	  maven { url 'https://jitpack.io' }
	 }

implementation 'com.github.EleshBaraiya:Live-Camera-Color-Picker:0.1.0'

Register in Manifest

<activity android:name="com.tatwadeep.livecameracolorpickerlib.PickColorActivity" />

Your Activity

startActivityForResult(new Intent(MainActivity.this, PickColorActivity.class), PickColorActivity.REQUEST_PIC_COLOR);

Get Color Code From Activity Result

   @Override
   protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == RESULT_OK && requestCode == PickColorActivity.REQUEST_PIC_COLOR) {
        String color_code = data.getExtras().getString(PickColorActivity.COLOR_CODE);
        mTextView.setBackgroundColor(Color.parseColor(color_code));
        System.out.println("==Colorcode==" + color_code);


    }
}

alt text

About

Live Camera Color Picker is an Android application that lets you capture, in real time, the colors around you using the camera of your device.


Languages

Language:Java 100.0%