Invert a color with Bitwise.OnesComplement?

  1. 2 weeks ago

    Aaron H

    Jan 10 Pre-Release Testers Europe (Germany)

    I want to invert a color, and I'm making some dumb mistake. Can anyone tell me why this doesn't work?

    // start with some color
    dim v as variant = g.ForeColor 
    // invert it
    v = Bitwise.OnesComplement( v )
    g.ForeColor = v.ColorValue
    // and it doesn't work

    seems to work just fine for me.... but remember that it also inverts the ALPHA value.... which might make your result transparent.

  2. Norman P

    Jan 10 Pre-Release Testers, Xojo Pro outside

    define "doesnt work" ?

  3. Dave S

    Jan 10 Answer San Diego, California USA

    seems to work just fine for me.... but remember that it also inverts the ALPHA value.... which might make your result transparent.

  4. Aaron H

    Jan 10 Pre-Release Testers Europe (Germany)

    Thanks Dave, that was the problem :)

or Sign Up to reply!