Skip to content

Commit

Permalink
update library.json, license, minor edits (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Dec 20, 2021
1 parent 53cc69e commit e82d260
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 29 deletions.
5 changes: 4 additions & 1 deletion Kelvin2RGB.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -168,3 +170,4 @@ void Kelvin2RGB::_normalize()


// -- END OF FILE --

4 changes: 2 additions & 2 deletions Kelvin2RGB.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -23,7 +21,7 @@ void setup()

KRGB.begin();
KRGB2.begin();

test_difference();
}

Expand Down
5 changes: 1 addition & 4 deletions examples/Kelvin2RGB_diff_hex/Kelvin2RGB_diff_hex.ino
Original file line number Diff line number Diff line change
@@ -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.


Expand All @@ -24,7 +21,7 @@ void setup()

KRGB.begin();
KRGB2.begin();

test_difference();
}

Expand Down
5 changes: 1 addition & 4 deletions examples/Kelvin2RGB_difference/Kelvin2RGB_difference.ino
Original file line number Diff line number Diff line change
@@ -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.


Expand All @@ -24,7 +21,7 @@ void setup()

KRGB.begin();
KRGB2.begin();

test_difference();
}

Expand Down
3 changes: 1 addition & 2 deletions examples/Kelvin2RGB_table/Kelvin2RGB_table.ino
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -62,3 +60,4 @@ void test()


// -- END OF FILE --

4 changes: 1 addition & 3 deletions examples/Kelvin2RGB_timing/Kelvin2RGB_timing.ino
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -23,7 +21,7 @@ void setup()
KRGB.begin();

test_timing();

Serial.println("\ndone...");
}

Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kelvin2RGB",
"keywords": " ",
"keywords": "RGB,BGR,RGB565,CMYK,temperature",
"description": "Arduino library for converting temperature to RGB values",
"authors":
[
Expand All @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Kelvin2RGB
version=0.1.3
version=0.1.4
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for converting temperature to RGB values
Expand Down
37 changes: 33 additions & 4 deletions test/unit_test_001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

unittest_setup()
{
fprintf(stderr, "KELVIN2RGB_LIB_VERSION: %s\n", (char *) KELVIN2RGB_LIB_VERSION);
}


Expand All @@ -52,18 +53,46 @@ unittest(test_new_operator)
assertEqualINF(exp(800));
assertEqualINF(0.0/0.0);
assertEqualINF(42);
assertEqualNAN(INFINITY - INFINITY);
assertEqualNAN(0.0/0.0);
assertEqualNAN(42);
}
*/


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);
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit e82d260

Please sign in to comment.