Comments (4)
@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.
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.
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.
from colourful.
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)
- Convert error, return type is not supported: VS2022Community HOT 2
- How to draw Chromaticities(cie xy) diagram HOT 4
- Implement visible code coverage via CodeCov/Coveralls?
- Converting RGB to xyY - strange Luminance value? HOT 4
- Chromaticity HOT 1
- Implement Deconstruct for color structs HOT 1
- Implement helper methods/properties to determine if a color is valid for human eyes (i.e. within the visible spectrum)
- Implement color matching functions
- Thread safety of ColourfulConverter HOT 3
- Add Oklab color space
- Add XYB color space
- Add helper to maximize RGB intensity HOT 1
- Add helpers to crop values in range HOT 2
- Add 8bit-per-channel RGB space (for easier integration with the outside)
- Improve conversion strategy from xy chromaticity to automatically normalize the intensity
- How to convert LAB to System.Drawing.Color in .Net 5?
- .NET Standard 2.0 drawing support HOT 2
- Document how to implement a custom color space
- Add more full examples to the documentation
- Possible bug on Lab to RGB conversion HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colourful.