Giter VIP home page Giter VIP logo

Comments (4)

tompazourek avatar tompazourek commented on July 23, 2024 1

@hacky97 It looks like your Unity project doesn't support the higher version of C# than 6.0 (unless it can be configured somewhere).

But why do you need to include the source code of the library? Can't you just reference the binaries or the NuGet package?

from colourful.

tompazourek avatar tompazourek commented on July 23, 2024

Hi there,

The "type pattern matching" is a feature of the C# language, not the .NET Framework. Even though the library uses features from a later version of C# (7.3), it can still be used in .NET 4.5 or .NET Standard 1.1, which means you should be able to use it with Unity.

The in and readonly were added recently with the v2 release to eliminate allocations as a performance improvement. See: #43

If you want to use a version without these, just use the previous version, v1.

from colourful.

hacky97 avatar hacky97 commented on July 23, 2024

Thanks for the clarification Tom. I keep mixing c# versions with .NET versions.
Unity won't swallow it however. I set he API compatibility level of Unity 2017.3.0f3 to .NET 4.6 and it simply spits errors about the above syntax.
I guess that's because Unity does not really use .NET, but a forked version that's being kept "up-to-date" on top of Mono.
image
image

from colourful.

hacky97 avatar hacky97 commented on July 23, 2024

No, I don't think I really need the source.
The nuget package manager in VS won't fool Unity however, but with the nuget asset from the Unity asset store I was able to download Colourful into the unity project and run a test.
Thanks!

Edit:
Had to add ref keywords to the sample code too:
double deltaE = new CIEDE2000ColorDifference().ComputeDifference(ref color1, ref color2);
(VS shows errors here, but Unity will compile fine)

from colourful.

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.