diff --git a/Kelvin2RGB.cpp b/Kelvin2RGB.cpp index 0c0ad46..681290f 100644 --- a/Kelvin2RGB.cpp +++ b/Kelvin2RGB.cpp @@ -1,7 +1,7 @@ // // FILE: Kelvin2RGB.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.3 +// VERSION: 0.1.4 // DATE: 2018-01-31 // PURPOSE: Arduino library for converting temperature to RGB values // URL: https://github.com/RobTillaart/Kelvin2RGB @@ -12,6 +12,8 @@ // 0.1.2 2021-06-01 add RGB565() - 16 bit colour - output // 0.1.3 2021-11-06 update build-CI, badges // add setRGB(), CMYK(), BGR(), reset(); +// 0.1.4 2021-12-20 update library.json, license, minor edits + #include "Kelvin2RGB.h" @@ -168,3 +170,4 @@ void Kelvin2RGB::_normalize() // -- END OF FILE -- + diff --git a/Kelvin2RGB.h b/Kelvin2RGB.h index 6d3c478..a26a7da 100644 --- a/Kelvin2RGB.h +++ b/Kelvin2RGB.h @@ -2,14 +2,14 @@ // // FILE: Kelvin2RGB.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.3 +// VERSION: 0.1.4 // DATE: 2018-01-31 // PURPOSE: Arduino library for converting temperature to RGB values // URL: https://github.com/RobTillaart/Kelvin2RGB // -#define KELVIN2RGB_LIB_VERSION (F("0.1.3")) +#define KELVIN2RGB_LIB_VERSION (F("0.1.4")) #include "Arduino.h" diff --git a/LICENSE b/LICENSE index 0feff1d..2ede7a7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2021 Rob Tillaart +Copyright (c) 2018-2022 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d7f399b..0d18fb9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ # Kelvin2RGB -Arduino library for converting temperature and brightness to RGB values +Arduino library for converting temperature and brightness to RGB values. ## Credentials @@ -27,7 +27,7 @@ however these are not investigated. On request these can be added. The library converts a temperature in Kelvin and a brightness (0..100%) to 3 numbers red, green and blue. -These numbers are weights can be used to correct a colorimage for virtual white temperature. +These numbers are weights can be used to correct a colour image for virtual white temperature. There are 2 convert functions where the **convert_NB()** is claimed to be the more accurate one. diff --git a/examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino b/examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino index 468a54c..45296bf 100644 --- a/examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino +++ b/examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino @@ -1,12 +1,10 @@ // // FILE: Kelvin2RGB565_diff_hex.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 // PURPOSE: demo - shows difference between 2 convert functions for the 565 16 bit coding // DATE: 2021-06-01 // URL: https://github.com/RobTillaart/Kelvin2RGB // - // shows difference between the two calculations @@ -23,7 +21,7 @@ void setup() KRGB.begin(); KRGB2.begin(); - + test_difference(); } diff --git a/examples/Kelvin2RGB_diff_hex/Kelvin2RGB_diff_hex.ino b/examples/Kelvin2RGB_diff_hex/Kelvin2RGB_diff_hex.ino index 9da850c..538273e 100644 --- a/examples/Kelvin2RGB_diff_hex/Kelvin2RGB_diff_hex.ino +++ b/examples/Kelvin2RGB_diff_hex/Kelvin2RGB_diff_hex.ino @@ -1,13 +1,10 @@ // // FILE: Kelvin2RGB_diff_hex.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 // PURPOSE: demo - shows difference between 2 convert functions for the 565 16 bit coding // DATE: 2021-06-01 // URL: https://github.com/RobTillaart/Kelvin2RGB // - -// shows difference between the two calculations // best viewed in plotter. @@ -24,7 +21,7 @@ void setup() KRGB.begin(); KRGB2.begin(); - + test_difference(); } diff --git a/examples/Kelvin2RGB_difference/Kelvin2RGB_difference.ino b/examples/Kelvin2RGB_difference/Kelvin2RGB_difference.ino index ed01f64..5fbd190 100644 --- a/examples/Kelvin2RGB_difference/Kelvin2RGB_difference.ino +++ b/examples/Kelvin2RGB_difference/Kelvin2RGB_difference.ino @@ -1,13 +1,10 @@ // // FILE: Kelvin2RGB_difference.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 // PURPOSE: demo - shows difference between 2 convert functions. // DATE: 2020-07-29 // URL: https://github.com/RobTillaart/Kelvin2RGB // - -// shows difference between the two calculations // best viewed in plotter. @@ -24,7 +21,7 @@ void setup() KRGB.begin(); KRGB2.begin(); - + test_difference(); } diff --git a/examples/Kelvin2RGB_table/Kelvin2RGB_table.ino b/examples/Kelvin2RGB_table/Kelvin2RGB_table.ino index 86c8f12..24b5ff0 100644 --- a/examples/Kelvin2RGB_table/Kelvin2RGB_table.ino +++ b/examples/Kelvin2RGB_table/Kelvin2RGB_table.ino @@ -1,11 +1,9 @@ // // FILE: Kelvin2RGB_table.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 // PURPOSE: generate table of values // DATE: 2020-07-29 // URL: https://github.com/RobTillaart/Kelvin2RGB -// #include "Kelvin2RGB.h" @@ -62,3 +60,4 @@ void test() // -- END OF FILE -- + diff --git a/examples/Kelvin2RGB_timing/Kelvin2RGB_timing.ino b/examples/Kelvin2RGB_timing/Kelvin2RGB_timing.ino index 9be3e45..d428fd8 100644 --- a/examples/Kelvin2RGB_timing/Kelvin2RGB_timing.ino +++ b/examples/Kelvin2RGB_timing/Kelvin2RGB_timing.ino @@ -1,11 +1,9 @@ // // FILE: Kelvin2RGB_timing.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.1 // PURPOSE: demo - shows timing 2 methods // DATE: 2020-07-29 // URL: https://github.com/RobTillaart/Kelvin2RGB -// #include "Kelvin2RGB.h" @@ -23,7 +21,7 @@ void setup() KRGB.begin(); test_timing(); - + Serial.println("\ndone..."); } diff --git a/library.json b/library.json index d07f54d..b251737 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Kelvin2RGB", - "keywords": " ", + "keywords": "RGB,BGR,RGB565,CMYK,temperature", "description": "Arduino library for converting temperature to RGB values", "authors": [ @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/Kelvin2RGB.git" }, - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index c4a5f11..acfb165 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Kelvin2RGB -version=0.1.3 +version=0.1.4 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for converting temperature to RGB values diff --git a/test/unit_test_001.cpp b/test/unit_test_001.cpp index fcfbd8a..5dc68e7 100644 --- a/test/unit_test_001.cpp +++ b/test/unit_test_001.cpp @@ -38,6 +38,7 @@ unittest_setup() { + fprintf(stderr, "KELVIN2RGB_LIB_VERSION: %s\n", (char *) KELVIN2RGB_LIB_VERSION); } @@ -52,7 +53,7 @@ unittest(test_new_operator) assertEqualINF(exp(800)); assertEqualINF(0.0/0.0); assertEqualINF(42); - + assertEqualNAN(INFINITY - INFINITY); assertEqualNAN(0.0/0.0); assertEqualNAN(42); @@ -60,10 +61,38 @@ unittest(test_new_operator) */ +unittest(test_constants) +{ + assertEqual(DLS_dark , 0); + assertEqual(DLS_match , 1700); + assertEqual(DLS_sodiumLamp , 1700); + assertEqual(DLS_candleFlame , 1850); + assertEqual(DLS_sunrise , 1850); + assertEqual(DLS_sunset , 1850); + assertEqual(DLS_bulb , 2400); + assertEqual(DLS_bulbSoftWhite , 2550); + assertEqual(DLS_LEDlamp , 2700); + assertEqual(DLS_warmWhite , 3000); + assertEqual(DLS_studioLight , 3200); + assertEqual(DLS_studioCPlight , 3350); + assertEqual(DLS_daylightHorizon, 5000); + assertEqual(DLS_flashLight , 5700); + assertEqual(DLS_xenonLight , 6200); + assertEqual(DLS_dayLightBright , 6500); + assertEqual(DLS_normal , 6500); + assertEqual(DLS_screenlow , 6500); + assertEqual(DLS_screenMed , 8000); + assertEqual(DLS_screenHigh , 9500); + assertEqual(DLS_polewardSky0 , 15000); + assertEqual(DLS_polewardSky1 , 19000); + assertEqual(DLS_polewardSky2 , 23000); + assertEqual(DLS_polewardSky3 , 27000); +} + + + unittest(test_constructor) { - fprintf(stderr, "VERSION: %s\n", (char *) KELVIN2RGB_LIB_VERSION); - Kelvin2RGB tempColor; assertEqualFloat(0, tempColor.temperature(), 0.0001); @@ -113,7 +142,7 @@ unittest(test_colour_spaces) fprintf(stderr, "test_colour_spaces\n"); tempColor.setRGB(0.50, 1.00, 0.75, 90); // brightness in % - + fprintf(stderr, "BRIGHT: %f\n", tempColor.brightness()); fprintf(stderr, "RED : %f\n", tempColor.red()); fprintf(stderr, "GREEN : %f\n", tempColor.green());