Giter Club home page Giter Club logo

android-color-picker's People

Contributors

bayramcicek avatar dependabot-preview[bot] avatar n7k avatar smelfungus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-color-picker's Issues

Get hex value from IntegerHSLColor

I set a listener for the hue seekbar, then I wanted to get the Hex value for the picked color, so after some searching, I managed to write an extension function to accomplish just that, but it didn't work ๐Ÿ˜ž

fun IntegerHSLColor.toHex(): String {
    val color = floatArrayOf(floatH, floatS / 100, floatL / 100)
    val intColor = HSLToColor(color)
    val red: Int = Color.red(intColor)
    val green: Int = Color.green(intColor)
    val blue: Int = Color.blue(intColor)
    return String.format("#%02x%02x%02x", red, green, blue)
}
colorSeekbar.addListener(object :
          ColorSeekBar.OnColorPickListener<ColorSeekBar<IntegerHSLColor>, IntegerHSLColor> {
          override fun onColorPicked(
              picker: ColorSeekBar<IntegerHSLColor>,
              color: IntegerHSLColor,
              value: Int,
              fromUser: Boolean
          ) {
              val colorHex = color.toHex()
              "onColorPicked colorHex = $colorHex".log()
          }

          override fun onColorChanged(
              picker: ColorSeekBar<IntegerHSLColor>,
              color: IntegerHSLColor,
              value: Int
          ) {}

          override fun onColorPicking(
              picker: ColorSeekBar<IntegerHSLColor>,
              color: IntegerHSLColor,
              value: Int,
              fromUser: Boolean
          ) {}

      })

No matter what color I choose, it always logs this value :

/>>:  onColorPicked colorHex = #010101

What am I doing wrong? is there a more straightforward way to get the hex value?

Jetpack Compose integration

I'm using Jetpack Compose, but the library has no native support of Compose so I have to use AndroidView() to integrate this library to composable. It would be wonderful to add native support for Compose, or at least write a guide on how to use this library correctly through AndroidView

Vertical picker

Hey man, cool work you've done here!

Would it be possible to display the picker vertically ?

Implement RGB seekbars

Implement RGB seek bars, add RGB Alpha support and all the related ecosystem components like converters, models, samples, etc.

Lower Minimum SDK

Is your feature request related to a problem? Please describe.
Current minimum SDK is set to API 21. For example my app supports back to API 19. I can't use this library :(

Describe the solution you'd like
Support lower API versions.

[BUG] error: cannot access KMappedMarker

This one is confusing me.. I was using the color picker just fine yesterday and now today the project is failing to build with the compiler error:

/Users/jpage/working/projects/hubitat-dashboard/app/src/main/java/com/jpage4500/hubitat/ui/fragments/DashboardFragment.java:654: error: cannot access KMappedMarker
        group.registerPicker(dialogLayout.colorSeekBar);
             ^
  class file for kotlin.jvm.internal.markers.KMappedMarker not found

It's complaining about the lines here:

        PickerGroup<IntegerHSLColor> group = new PickerGroup<>();
        group.registerPicker(dialogLayout.colorSeekBar);
        group.registerPicker(dialogLayout.saturationSeekBar);
        group.registerPicker(dialogLayout.lightnessSeekBar);

I imagine this isn't related to your library since it was building just fine yesterday. But, I can't figure out what changed or why it's now all of the sudden failing to compile so I figured someone here might have an idea why

Define the size in the code

  <dimen name="acp_seek_progress_corner_radius">4dp</dimen>
  <dimen name="acp_seek_progress_padding">5dp</dimen>
  <dimen name="acp_seek_progress_height">10dp</dimen>
  <dimen name="acp_thumb_stroke_width">4dp</dimen>
  <dimen name="acp_thumb_size_full">20dp</dimen>
  <dimen name="acp_thumb_size_default">24dp</dimen>
  <dimen name="acp_thumb_ripple_radius">15dp</dimen>
  1. The value defined above can be set in the code

  2. SeekBar can customize the color array

Roadmap

๐Ÿš€ Roadmap

  • Add more picker types
    • HLS SeekBars
    • RGB SeekBars
    • RGB circle
    • RGB plane
    • HSV/HSB seekbars
    • CMYK SeekBars
    • Alpha SeekBars
    • HSL (S+L) plane
    • LAB
    • XYZ
    • YPbPr
    • Swatches
  • Extend picker types
    • CMYK SeekBars coloring modes
    • More awesome swatches
    • More supported alpha color models
  • Sample buttons -> radios
  • Remove sample app child press delays
  • Enhance API
  • Add XML attributes
  • Provide git-flow
  • Automate release/publish flow
  • Add thumb animation
  • Add MaterialDrawer & sample fragments
  • Add more HSLColorPickerSeekBar checks and reduce calls count
  • Add more encapsulation to limit picker modification capabilities
  • Package repository publish (Bintray)
  • Add Rx support
  • Add/Revisit RecyclerView support
  • Add sample app icon
  • Add logger solution
  • Add sample app analytics
  • Add GIFs media
  • Add call flow diagram
  • Add tests
  • Add docs
  • Add contribution guidelines
  • Add OSS licenses
  • Add license

[BUG] android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class codes.side.andcolorpicker.hsl.HSLColorPickerSeekBar

Describe the bug
When I want to add the view to my main activity.xml I get an inflate error.

To Reproduce
Steps to reproduce the behavior:

  1. Add implementation "codes.side:andcolorpicker:0.5.0" to app/build.gradle
  2. Add: <codes.side.andcolorpicker.hsl.HSLColorPickerSeekBar android:layout_width="200dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" android:layout_height="wrap_content" app:hslMode="hue" /> to main_activity.xml
  3. Run the project
  4. See error

Expected behavior
It should run and the slider should be visible

Extra information
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable.mutate()' on a null object reference at codes.side.andcolorpicker.view.picker.ColorSeekBar.setupBackground(ColorSeekBar.kt:121) at codes.side.andcolorpicker.view.picker.ColorSeekBar.<init>(ColorSeekBar.kt:106) 2021-04-06 12:16:53.779 24098-24098/com.prowise.service.pronote_2021 E/AndroidRuntime: at codes.side.andcolorpicker.view.picker.GradientColorSeekBar.<init>(GradientColorSeekBar.kt:16) at codes.side.andcolorpicker.hsl.HSLColorPickerSeekBar.<init>(HSLColorPickerSeekBar.kt:27) at codes.side.andcolorpicker.hsl.HSLColorPickerSeekBar.<init>(HSLColorPickerSeekBar.kt:25) at codes.side.andcolorpicker.hsl.HSLColorPickerSeekBar.<init>(Unknown Source:6) ... 30 more

Hue suggestion

Please consider including White color at the start of the Hue palette and Black at the end of it, so all the colors can be chosen from the Hue palette without need to insert the second Intensity palette.

[BUG] Update Readme.

Describe the bug
Error in Readme. Line 90 object : HSLColorPickerSeekBar.DefaultOnColorPickListener()

As per your Example app/src/main/java/codes/side/andcolorpicker/app/fragment/HSLSeekBarGithubSampleFragment.kt

Line Should be : object : OnIntegerHSLColorPickListener()

[BUG] Saturation value not taken into account for Lightness bar updated via setPickedColor()

When choosing a color via the 3 bars (H,S,L), I retrieve the current IntegerHSLColor and then use this to update each of the bars via setPickedColor(). Hue changes the S & L bar colors, but Saturation changes have no effect. So choosing zero for Saturation to give black <-> white should change the L bar to be just this, i.e. black on the left to white on the right. Instead it stays at whatever color the H bar is set to.

This doesn't affect the returned values, just the colour displayed on the L bar.

Apart from that, this library rocks. Many thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.