{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Colors","type":"basic","slug":"colors","excerpt":"How to define a color.","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:[1500-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.","updates":[],"order":5,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55f28173f9f3991900f38a1c","version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["55f28172f9f3991900f38a14","55f28172f9f3991900f38a15","55f28172f9f3991900f38a16","55f66acb297b37170058accb","5d229ff5e59b8e003ab3a9da"],"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","releaseDate":"2015-09-11T07:23:30.065Z","createdAt":"2015-09-11T07:23:30.065Z","__v":3},"__v":4,"category":{"sync":{"isSync":false,"url":""},"pages":["55f28173f9f3991900f38a17","55f28173f9f3991900f38a18","55f28173f9f3991900f38a19","55f28173f9f3991900f38a1a","55f28173f9f3991900f38a1b","55f28173f9f3991900f38a1c"],"title":"Overview","slug":"overview","order":1,"from_sync":false,"reference":false,"_id":"55f28172f9f3991900f38a15","version":"55f28172f9f3991900f38a13","__v":1,"createdAt":"2015-06-17T04:27:26.544Z","project":"54ebb40d6423300d003672c0"},"githubsync":"","project":"54ebb40d6423300d003672c0","createdAt":"2015-06-17T05:15:00.794Z","user":"557e2561eb75d80d00af3dab","parentDoc":null}
Colors
How to define a color.