Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

[REQUEST] Optional alpha channel #9

Open
aexvir opened this issue Sep 17, 2017 · 3 comments
Open

[REQUEST] Optional alpha channel #9

aexvir opened this issue Sep 17, 2017 · 3 comments

Comments

@aexvir
Copy link

aexvir commented Sep 17, 2017

Hi, I'm using this library for a personal project where I place the progressbar between an image and a panel, with the default alpha channel it doesn't look very fine. I suggest accepting parameters for the not filled bars color, for the filled bars color and also for the alpha channel instead of using a hardcoded alpha value.

@aexvir
Copy link
Author

aexvir commented Sep 18, 2017

I have started to work on this feature and I have made some progress. First of all I've declared two new attributes alphaChannel (float between 0 and 1.0) and waveBackgroundColor (color). The alphaChannel attribute has a default value of 0.66 (0xAA)

If the user only sets the waveColor the progressbar works exactly the same as now. wavePaint is initialized with smoothColor() of the waveColor with the alphaChannel applied and waveFilledPaint is initialized with filterColor() of the waveColor with the alphaChannel applied.

It waveBackgroundColor is also set, wavePaint is set to smoothColor() of the waveBackgroundColor with the alphaChannel applied and waveFilledPaint is set to smoothColor() of the waveColor with the alphaChannel applied.

I've made tests and the colors are applying but I have issues with the drawing of the rects... . first of all there is redrawData which already needs a color (wavePaint) and also there is the onDraw method which uses both wavePaint and waveFilledPaint to paint the rects.

The result I'm getting is like some kind of composition of the colors, like they are blending in some way, not pure colors.

I will look into it again today.

@alxrm
Copy link
Owner

alxrm commented Sep 18, 2017

@proudh0n sorry for non-replying to you, lacking of free time

Yet thanks for your contribution, variable alphaChannel and opaque colors were on my todo list, so I'd appreciate your work a lot!

I'll try to look at the code later today and help you if necessary

@aexvir
Copy link
Author

aexvir commented Sep 18, 2017

Hi @alxrm I've contacted you on telegram. When you have some time please answer me. Many thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants