added color correction
This commit is contained in:
parent
e5caab5692
commit
ef0f57fd0d
11
color.php
11
color.php
|
@ -22,6 +22,11 @@ if(!in_array($mode, ['s', 'y', 'f'])) {
|
||||||
$mode = 's';
|
$mode = 's';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$stromstoss = $_GET['stromstoss'];
|
||||||
|
if(!$stromstoss==1) {
|
||||||
|
$stromstoss = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$red = hexdec(substr($value, 0, 2));
|
$red = hexdec(substr($value, 0, 2));
|
||||||
$green = hexdec(substr($value, 2, 2));
|
$green = hexdec(substr($value, 2, 2));
|
||||||
$blue = hexdec(substr($value, 4, 2));
|
$blue = hexdec(substr($value, 4, 2));
|
||||||
|
@ -37,6 +42,12 @@ if(is_int($step)) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($stromstoss==0) {
|
||||||
|
$red=$red;
|
||||||
|
$green=$green*200/255;
|
||||||
|
$blue=$blue*128/255;
|
||||||
|
}
|
||||||
|
|
||||||
echo $url . '5' . '%20' . $red . '%20' . $mode . "\n";
|
echo $url . '5' . '%20' . $red . '%20' . $mode . "\n";
|
||||||
echo http_response($ch, $url . '5' . '%20' . $red . '%20' . $mode);
|
echo http_response($ch, $url . '5' . '%20' . $red . '%20' . $mode);
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
|
@ -62,6 +62,8 @@
|
||||||
<label for="mode-instant">Sofort</label>
|
<label for="mode-instant">Sofort</label>
|
||||||
<input id="mode-fade" name="mode" type="radio" value="f" checked="checked">
|
<input id="mode-fade" name="mode" type="radio" value="f" checked="checked">
|
||||||
<label for="mode-fade">Geschmeidig</label><br />
|
<label for="mode-fade">Geschmeidig</label><br />
|
||||||
|
<input id="mode-stromstoss" name="stromstoss" type="checkbox" value="1">
|
||||||
|
<label for="mode-stromstoss">Stromstoß</label><br />
|
||||||
<button type="submit" id="submit">Erhelle mich!</button>
|
<button type="submit" id="submit">Erhelle mich!</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,7 +90,7 @@
|
||||||
values[data[i]['name']] = data[i]['value'];
|
values[data[i]['name']] = data[i]['value'];
|
||||||
};
|
};
|
||||||
|
|
||||||
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep']});
|
$.get('color.php' ,{'value': values['color'], 'mode': values['mode'], 'fadestep': values['fadestep'], 'stromstoss': values['stromstoss']});
|
||||||
};
|
};
|
||||||
$('#changeLight').submit(callback);
|
$('#changeLight').submit(callback);
|
||||||
$('#submit').on('click,enter', callback);
|
$('#submit').on('click,enter', callback);
|
||||||
|
|
Loading…
Reference in New Issue