{"_id":"5c64ffec00892c00ecc173ee","project":"54ebb40d6423300d003672c0","version":{"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","__v":2,"createdAt":"2015-09-11T07:23:30.065Z","releaseDate":"2015-09-11T07:23:30.065Z","categories":["55f28172f9f3991900f38a14","55f28172f9f3991900f38a15","55f28172f9f3991900f38a16","55f66acb297b37170058accb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"55f28172f9f3991900f38a16","__v":3,"pages":["55f28173f9f3991900f38a1d","55f28173f9f3991900f38a1e","55f28173f9f3991900f38a1f","55f28173f9f3991900f38a20","55f28173f9f3991900f38a21","55f28173f9f3991900f38a22","55f28173f9f3991900f38a23","55f28173f9f3991900f38a24","55f28173f9f3991900f38a25","55f28173f9f3991900f38a26","55f28173f9f3991900f38a27","55f63d46fe4cce21005c785e","55f65cc16be5ea0d00bbbf4c"],"project":"54ebb40d6423300d003672c0","version":"55f28172f9f3991900f38a13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T05:23:31.147Z","from_sync":false,"order":2,"slug":"api-endpoints","title":"API Endpoints"},"user":"57749b725b96cf0e00558ea6","__v":4,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-02-14T05:43:08.442Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[{"name":null,"language":"curl","code":"curl -X POST \"https://api.lifx.com/v1/lights/all/effects/morph\" \\\n     -H \"Authorization: Bearer [[app:Token]]\" \\\n     -H \"Content-Type:application/json\" \\\n     -d '{\"power_on\": true}'"},{"code":"import requests\n\ntoken = \"[[app:Token]]\"\n\nheaders = {\n    \"Authorization\": \"Bearer %s\" % token,\n}\n\ndata = {\n    \"power_on\": True\n}\n\nresponse = requests.post('https://api.lifx.com/v1/lights/all/effects/morph', data=data, headers=headers)","language":"python"}]},"settings":"","results":{"codes":[{"status":"2XX","language":"json","code":"{\n  \"results\": [\n    {\n      \"id\": \"d3b2f2d97452\",\n      \"label\": \"My tile\",\n      \"status\": \"ok\"\n    }\n  ]\n}","name":""}]},"auth":"required","params":[{"_id":"5c47d63469cb1d04074725d3","ref":"","in":"path","required":false,"desc":"The [selector](doc:selectors) to limit which devices will run the effect.","default":"","type":"string","name":"selector"},{"_id":"5c47d5fd69cb1d04074725d1","ref":"","in":"body","required":false,"desc":"This controls how quickly the morph runs. It is measured in seconds. A lower number means the animation is faster","default":"5","type":"double","name":"period"},{"_id":"5c64ffec00892c00ecc173ef","ref":"","in":"body","required":false,"desc":"How long the animation lasts for in seconds. Not specifying a duration makes the animation never stop. Specifying 0 makes the animation stop. Note that there is a known bug where the tile remains in the animation once it has completed if duration is nonzero.","default":"infinite","type":"float","name":"duration"},{"_id":"5c64ffec00892c00ecc173f0","ref":"","in":"body","required":false,"desc":"You can control the colors in the animation by specifying a list of color specifiers. For example `[\"red\", \"hue:100 saturation:1\"]`. See https://api.developer.lifx.com/docs/colors","default":"7 colours across the spectrum","type":"array_string","name":"palette"},{"_id":"5c47d5fd69cb1d04074725cf","ref":"","in":"body","required":false,"desc":"Switch any selected device that is off to on before performing the effect.","default":"true","type":"boolean","name":"power_on"}],"url":"/lights/:selector/effects/morph"},"isReference":false,"order":8,"body":"Performs a morph effect on the tiles in your selector. Use the parameters to tweak the effect. Note that the brightness of the morph is determined by the brightness of the tile, rather than the brightness of the colours in the palette. To change the brightness, use the SetState endpoint.","excerpt":"","slug":"morph-effect","type":"endpoint","title":"Morph Effect"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

selector:
string
The [selector](doc:selectors) to limit which devices will run the effect.

Body Params

period:
double5
This controls how quickly the morph runs. It is measured in seconds. A lower number means the animation is faster
duration:
floatinfinite
How long the animation lasts for in seconds. Not specifying a duration makes the animation never stop. Specifying 0 makes the animation stop. Note that there is a known bug where the tile remains in the animation once it has completed if duration is nonzero.
palette:
array of strings7 colours across the spectrum
You can control the colors in the animation by specifying a list of color specifiers. For example `["red", "hue:100 saturation:1"]`. See https://api.developer.lifx.com/docs/colors
power_on:
booleantrue
Switch any selected device that is off to on before performing the effect.

Examples


Result Format


Documentation

Performs a morph effect on the tiles in your selector. Use the parameters to tweak the effect. Note that the brightness of the morph is determined by the brightness of the tile, rather than the brightness of the colours in the palette. To change the brightness, use the SetState endpoint.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}