{"__v":3,"_id":"55f28173f9f3991900f38a1c","category":{"__v":1,"_id":"55f28172f9f3991900f38a15","pages":["55f28173f9f3991900f38a17","55f28173f9f3991900f38a18","55f28173f9f3991900f38a19","55f28173f9f3991900f38a1a","55f28173f9f3991900f38a1b","55f28173f9f3991900f38a1c"],"project":"54ebb40d6423300d003672c0","version":"55f28172f9f3991900f38a13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T04:27:26.544Z","from_sync":false,"order":1,"slug":"overview","title":"Overview"},"project":"54ebb40d6423300d003672c0","user":"557e2561eb75d80d00af3dab","version":{"__v":2,"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-17T05:15:00.794Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"The color of light is best represented in terms of hue, saturation, kelvin, and brightness components. [Hue](http://en.wikipedia.org/wiki/Hue) and saturation describe color where as [kelvin describes warm and cool whites](http://en.wikipedia.org/wiki/Color_temperature#Categorizing_different_lighting). Extra care should be given when converting between RGB and HSBK as RGB poorly represents the color of light.\n\n  *     `#ff0000` – Deep red, maximum brightness\n  *     `hue:120 saturation:1.0 brightness:0.5` – Deep green, 50% brightness\n  *     `kelvin:2700 brightness: 0.5` – Warm white (2700 K), 50% brightness\n  *     `rgb:0,255,255` – Cyan, 100% brightness\n  *     `kelvin:5000` – Set kelvin to cool white (5000 K) and saturation to 0 without affecting other components\n  *     `kelvin:2700 saturation:1` – Set kelvin to warm (2700 K) and saturation to 1\n  *     `brightness:0.75` – Set brightness to 75% without affecting other components\n  *     `saturation:0.25` – Set saturation to 25% without affecting other components\n  *     `red` – Sets color to red but doesn't affect brightness\n \nOne or many of the `hue`, `saturation`, `kelvin`, and `brightness` components can be combined to describe the desired color.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Formatting Colors\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Format\",\n    \"h-1\": \"Example\",\n    \"h-2\": \"Notes\",\n    \"0-0\": \"`[name]`\",\n    \"0-1\": \"`white`, `red`, `orange`, `yellow`, `cyan`, `green`, `blue`, `purple`, or `pink`\",\n    \"0-2\": \"Sets the hue and saturation components, but leaves brightness untouched.\",\n    \"1-0\": \"`hue:[0-360]`\",\n    \"1-1\": \"`hue:120`\",\n    \"1-2\": \"Sets hue without affecting other components\",\n    \"2-0\": \"`saturation:[0.0-1.0]`\",\n    \"2-1\": \"`saturation:0.5`\",\n    \"2-2\": \"Sets saturation without affecting other components\",\n    \"3-0\": \"`brightness:[0.0-1.0]`\",\n    \"3-1\": \"`brightness:0.5`\",\n    \"3-2\": \"Sets brightness without affecting other components\",\n    \"4-0\": \"`kelvin:[2500-9000]`\",\n    \"4-1\": \"`kelvin:5000`\",\n    \"4-2\": \"Sets kelvin to the given value and saturation to `0.0`. Other components are not affected.\",\n    \"5-0\": \"`#RRGGBB`\",\n    \"5-1\": \"`#ff0000`\",\n    \"5-2\": \"Automatically converts to HSBK\",\n    \"6-0\": \"`rgb:[0-255],[0-255],[0-255]`\",\n    \"6-1\": \"`rgb:255,255,0`\",\n    \"6-2\": \"Automatically converts to HSBK\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Validating Colors\"\n}\n[/block]\nIf you need to validate user input, you can use the [Validate Color](doc:validate-color) endpoint.","excerpt":"How to define a color.","slug":"colors","type":"basic","title":"Colors"}

Colors

How to define a color.

The color of light is best represented in terms of hue, saturation, kelvin, and brightness components. [Hue](http://en.wikipedia.org/wiki/Hue) and saturation describe color where as [kelvin describes warm and cool whites](http://en.wikipedia.org/wiki/Color_temperature#Categorizing_different_lighting). Extra care should be given when converting between RGB and HSBK as RGB poorly represents the color of light. * `#ff0000` – Deep red, maximum brightness * `hue:120 saturation:1.0 brightness:0.5` – Deep green, 50% brightness * `kelvin:2700 brightness: 0.5` – Warm white (2700 K), 50% brightness * `rgb:0,255,255` – Cyan, 100% brightness * `kelvin:5000` – Set kelvin to cool white (5000 K) and saturation to 0 without affecting other components * `kelvin:2700 saturation:1` – Set kelvin to warm (2700 K) and saturation to 1 * `brightness:0.75` – Set brightness to 75% without affecting other components * `saturation:0.25` – Set saturation to 25% without affecting other components * `red` – Sets color to red but doesn't affect brightness One or many of the `hue`, `saturation`, `kelvin`, and `brightness` components can be combined to describe the desired color. [block:api-header] { "type": "basic", "title": "Formatting Colors" } [/block] [block:parameters] { "data": { "h-0": "Format", "h-1": "Example", "h-2": "Notes", "0-0": "`[name]`", "0-1": "`white`, `red`, `orange`, `yellow`, `cyan`, `green`, `blue`, `purple`, or `pink`", "0-2": "Sets the hue and saturation components, but leaves brightness untouched.", "1-0": "`hue:[0-360]`", "1-1": "`hue:120`", "1-2": "Sets hue without affecting other components", "2-0": "`saturation:[0.0-1.0]`", "2-1": "`saturation:0.5`", "2-2": "Sets saturation without affecting other components", "3-0": "`brightness:[0.0-1.0]`", "3-1": "`brightness:0.5`", "3-2": "Sets brightness without affecting other components", "4-0": "`kelvin:[2500-9000]`", "4-1": "`kelvin:5000`", "4-2": "Sets kelvin to the given value and saturation to `0.0`. Other components are not affected.", "5-0": "`#RRGGBB`", "5-1": "`#ff0000`", "5-2": "Automatically converts to HSBK", "6-0": "`rgb:[0-255],[0-255],[0-255]`", "6-1": "`rgb:255,255,0`", "6-2": "Automatically converts to HSBK" }, "cols": 3, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Validating Colors" } [/block] If you need to validate user input, you can use the [Validate Color](doc:validate-color) endpoint.