← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Set color picker color alpha channel to 1

 

KiCad recently (early 2017) moved from indexed color to full RGBA color,
and I picked the COLOR4D struct to do that because it was already in use
elsewhere for the 3D viewer (probably because OpenGL uses floating point
color).  It's kind of an arbitrary choice because any integer mapping can
be converted to float by OpenGL, but I can't think of a good reason to
change it just for the sake of change.

-Jon

On Fri, Sep 29, 2017 at 9:48 AM, Seppe Stas <seppestas@xxxxxxxxx> wrote:

> Ah, that indeed is a more logical fix.
>
> Just to adjust the vertical scale to give a “good” 3D rendering of the 3D
> RGB space in the 2D draw plane. The “good” value is a matter of taste.
>
> The vertical scaling of the Y axis cause aliasing (choppy gradient) on my
> system, as can be seen in the attached screenshot.
>
> Also, why does KiCad use floating point values to represent colors? IMO
> this does not make a lot of sense since most systems use a 24 or 32 bit
> color representation anyhow…
>
>
>
>
> On 29 September 2017 at 15:28:06, jp charras (jp.charras@xxxxxxxxxx)
> wrote:
>
> Le 29/09/2017 à 14:08, Seppe Stas a écrit :
> > Fixes lp:1718389 <https://bugs.launchpad.net/kicad/+bug/1718389>. The
> alpha channel of
> > |KIGFX::COLOR4D|, which is used to draw the color pickers, initialises
> to 0. This causes the color
> > picker to be invisible on platforms that support alpha channels in a
> |wxBitmap| (like macOS). This
> > patch sets the alpha channel of the color used to draw the color pickers
> to 1.
>
> Good catch Seppe.
>
> The main bug is in KIGFX::COLOR4D that initialize the opacity to 0.
> This is clearly a mistake.
> I just committed a fix to set the opacity to 1.0 (a normal value) and
> therefore fix this issue.
>
> >
> > This patch also simplifies the generation of the color channel bitmaps a
> bit and fixes weird scaling
> > issue of green-blue triangle
> > <https://launchpadlibrarian.net/339135271/Screen%20Shot%
> 202017-09-29%20at%2011.54.46.png>
> > @Jean-pierre, I’m not sure what the 0.9 factor was for, but removing it
> looks a lot nicer.
> >
> Just to adjust the vertical scale to give a "good" 3D rendering of the 3D
> RGB space in the 2D draw
> plane.
> The "good" value is a matter of taste.
>
> --
> Jean-Pierre CHARRAS
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
>

References