Giter Site home page Giter Site logo

Comments (6)

indragiek avatar indragiek commented on July 23, 2024

You could always just get the CGColorRef for the TUIColor and grab the components from there.

from twui.

alexzielenski avatar alexzielenski commented on July 23, 2024

That would be a bit redundant since this is already just an objective-c wrapper around CGColorRef and that would be what those methods would do.

from twui.

lorenbrichter avatar lorenbrichter commented on July 23, 2024

what's the fastest way to determine if a given cgcolorref is rgba?

from twui.

lorenbrichter avatar lorenbrichter commented on July 23, 2024

I think this would be best server with a single method

  • (void)getRed:(float *)r green:(float *)g blue:(float *)b alpha:(float *)a;

like NSColor - and would prevent the temptation to call multiple [color xxxComponent] methods back to back (which would be slower than this single multi-getter). It would be the caller's responsibility to ensure that the receiver is an RGBA color, and the only sanity check would be to confirm that the # of components == 4 (which is really fast).

from twui.

lorenbrichter avatar lorenbrichter commented on July 23, 2024

pushed getters for RGBA and LA (and renamed -alpha -> -alphaComponent to match NSColor)

from twui.

alexzielenski avatar alexzielenski commented on July 23, 2024

Thanks!

from twui.

Related Issues (20)

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.