Merge commit 'f03cd1ff7577b62a6ff475bde529ab7defa72553' into HEAD
commit
55c1505a6a
|
@ -402,15 +402,15 @@ val newColor = new Color(red, blue, green) // where red, blue, and green are int
|
||||||
MyColorItem.sendCommand(new HSBType(newColor))
|
MyColorItem.sendCommand(new HSBType(newColor))
|
||||||
```
|
```
|
||||||
|
|
||||||
When individual color values from a HSBType as a PercentType are retrieved, it will be necessary to multiply that PercentType by 255 to obtain a standard 8-bit per color channel RGB.
|
When individual color values from a HSBType as a PercentType are retrieved, it will be necessary to divide the PercentType by 100 and multiply by 255 to obtain a standard 8-bit per color channel RGB.
|
||||||
Correspondingly, the for 16 or 32 bit representation, the percent type needs to be multiplied the percent type by 16^2 or 32^2, respectively.
|
Correspondingly, for the 16 or 32 bit representation, the PercentType needs to divided by 100 and multiplied by 65535 (2 ^ 16 - 1) or 4294967295 (2 ^ 32 - 1), respectively.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
//Example for conversion to 8-bit representation
|
//Example for conversion to 8-bit representation
|
||||||
// In rule body
|
// In rule body
|
||||||
val red = (MyColorItem.state as HSBType).red * 255
|
val red = (MyColorItem.state as HSBType).red / 100 * 255
|
||||||
val green = (MyColorItem.state as HSBType).green * 255
|
val green = (MyColorItem.state as HSBType).green / 100 * 255
|
||||||
val blue = (MyColorItem.state as HSBType).blue * 255
|
val blue = (MyColorItem.state as HSBType).blue / 100 * 255
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Contact Item
|
##### Contact Item
|
||||||
|
|
|
@ -477,7 +477,6 @@ After=network-online.target
|
||||||
Type=simple
|
Type=simple
|
||||||
User=openhab
|
User=openhab
|
||||||
Group=openhab
|
Group=openhab
|
||||||
GuessMainPID=yes
|
|
||||||
WorkingDirectory=/opt/openhab2
|
WorkingDirectory=/opt/openhab2
|
||||||
#EnvironmentFile=/etc/default/openhab2
|
#EnvironmentFile=/etc/default/openhab2
|
||||||
ExecStart=/opt/openhab2/start.sh server
|
ExecStart=/opt/openhab2/start.sh server
|
||||||
|
|
Loading…
Reference in New Issue