Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

alternative values for the conversion matrices #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ikea-tradfri-rgb.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,10 @@ def colorXy2Rgb(x, y) {

// sRGB, Reference White D65
def M = [
[ 3.2410032, -1.5373990, -0.4986159 ],
[ -0.9692243, 1.8759300, 0.0415542 ],
[ 0.0556394, -0.2040112, 1.0571490 ]
[ 3.240479, -1.537150, -0.498535 ],
[ -0.969256, 1.875992, 0.041556 ],
[ 0.055648, -0.204043, 1.05731 ]

]

def r = X * M[0][0] + Y * M[0][1] + Z * M[0][2]
Expand Down Expand Up @@ -696,9 +697,9 @@ def colorRgb2Xy(r, g, b) {
// G 0.30000 0.60000
// B 0.15000 0.06000
def M = [
[ 0.4123866, 0.3575915, 0.1804505 ],
[ 0.2126368, 0.7151830, 0.0721802 ],
[ 0.0193306, 0.1191972, 0.9503726 ]
[ 0.412453, 0.357580, 0.180423 ],
[ 0.212671, 0.715160, 0.07216 ],
[ 0.019334, 0.119193, 0.950227 ]
]

def X = r * M[0][0] + g * M[0][1] + b * M[0][2]
Expand Down