NSColorWell and alpha

  • I have NSColorWell on my form bind to NSColor property in my
    Controller-object.
    In IB there is an alpha-slider available in  that colorwell to modify
    color opacity value but during runtime there isn't such.
    Is that bydesign or am I missing something?

    Thanks.
  • Hi Mike,

    This is controlled by -[NSColorPanel setShowsAlpha:].

    Try calling [[NSColorPanel sharedColorPanel] setShowsAlpha:YES].

    -Ken

    On Sun, Jun 1, 2008 at 9:23 AM, Mike <mike.mcfin...> wrote:
    > I have NSColorWell on my form bind to NSColor property in my
    > Controller-object.
    > In IB there is an alpha-slider available in  that colorwell to modify color
    > opacity value but during runtime there isn't such.
    > Is that bydesign or am I missing something?
    >
    > Thanks.
    >
  • That seems to do the trick. Thanks!

    Ken Ferry kirjoitti 1.6.2008 kello 19:33:

    > Hi Mike,
    >
    > This is controlled by -[NSColorPanel setShowsAlpha:].
    >
    > Try calling [[NSColorPanel sharedColorPanel] setShowsAlpha:YES].
    >
    > -Ken
    >
    > On Sun, Jun 1, 2008 at 9:23 AM, Mike <mike.mcfin...> wrote:
    >> I have NSColorWell on my form bind to NSColor property in my
    >> Controller-object.
    >> In IB there is an alpha-slider available in  that colorwell to
    >> modify color
    >> opacity value but during runtime there isn't such.
    >> Is that bydesign or am I missing something?
    >>
    >> Thanks.
    >>
  • Also note NSColor's setIgnoresAlpha:, especially the last sentence.

    "If the application doesn't support alpha, no opacity slider is
    displayed in the color panel, and colors dragged in or pasted have their
    alpha values set to 1.0. Applications that need to import alpha can
    invoke this method with flag set to NO and explicitly make colors opaque
    in cases where it matters to them. Note that calling this with a value
    of YES overrides any value set with the NSColorPanel method setShowsAlpha:."

    On 6/1/08 9:33 AM, Ken Ferry said:

    > This is controlled by -[NSColorPanel setShowsAlpha:].
    >
    > Try calling [[NSColorPanel sharedColorPanel] setShowsAlpha:YES].
    >
    > -Ken
    >
    > On Sun, Jun 1, 2008 at 9:23 AM, Mike <mike.mcfin...>  wrote:
    >> I have NSColorWell on my form bind to NSColor property in my
    >> Controller-object.
    >> In IB there is an alpha-slider available in  that colorwell to modify color
    >> opacity value but during runtime there isn't such.
    >> Is that bydesign or am I missing something?

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
previous month june 2008 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
Go to today