Olfarve 1.0.0
dotnet add package Olfarve --version 1.0.0
NuGet\Install-Package Olfarve -Version 1.0.0
<PackageReference Include="Olfarve" Version="1.0.0" />
<PackageVersion Include="Olfarve" Version="1.0.0" />
<PackageReference Include="Olfarve" />
paket add Olfarve --version 1.0.0
#r "nuget: Olfarve, 1.0.0"
#:package Olfarve@1.0.0
#addin nuget:?package=Olfarve&version=1.0.0
#tool nuget:?package=Olfarve&version=1.0.0
csolfarve
Øl farve ("beer color") renders SRM and EBC beer color values as sRGB colors, following the spectral model described by A. J. de Lange, "Color," in Brewing Materials and Processes, Elsevier, 2016, pp. 199-249.
Given a color value and an optical path length (the width of the glass the beer is viewed through), the sample's spectral transmittance is derived from its absorption coefficient at 430 nm via the Beer-Lambert law, integrated against the CIE 1931 color matching functions of the 2 degree standard colorimetric observer under illuminant D65, and the resulting XYZ tristimulus values are transformed to sRGB.
Installation
dotnet add package Olfarve
The package targets .NET 8 and .NET 10 and has no runtime dependencies. It is fully cross-platform (Windows, Linux, macOS).
Usage
using Olfarve;
using System.Drawing;
BeerColor.SrmToSrgb(10).ToHex();
BeerColor.EbcToSrgb(20).ToHex();
// The default path length is 5 cm, the width of a typical sample glass
BeerColor.SrmToSrgb(10, pathLengthCm: 1.0).ToHex();
// Results are SRGBColor records of gamma encoded components in [0, 1]
SRGBColor color = BeerColor.SrmToSrgb(10);
var (r, g, b) = color;
color.ToRgb8();
Color drawingColor = color.ToColor();
// Or start from an absorbance measured at 430 nm
BeerColor.AbsorptionToSrgb(0.7874);
Development
Requires the .NET 8 and .NET 10 SDKs (both, to build and test every target framework).
dotnet build
dotnet test
dotnet format --verify-no-changes
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 78 | 9/5/2026 |