How to use the color-convert.hwb function in color-convert

To help you get started, we’ve selected a few color-convert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thebespokepixel / trucolor / src / lib / classes / interpreter.js View on Github external
rgb: converter.hex.rgb(this.name)
					}
				case 'HSL':
					return {
						name: converter.hsl.hex(source.input),
						rgb: converter.hsl.rgb(source.input)
					}
				case 'HSV':
					return {
						name: converter.hsv.hex(source.input),
						rgb: converter.hsv.rgb(source.input)
					}
				case 'HWB':
					return {
						name: converter.hwb.hex(source.input),
						rgb: converter.hwb.rgb(source.input)
					}
				case 'SGR':
					return {
						name: source.input,
						rgb: source.input
					}
				case 'named':
					return {
						name: converter.keyword.hex(source.input),
						rgb: converter.keyword.rgb(source.input)
					}
				default:
					throw new Error(`Unrecognised color space: ${source.space}`)
			}
		})(this.source)
github thebespokepixel / trucolor / lib / index-es.js View on Github external
name: converter.rgb.hex(source.input),
						rgb: converter.hex.rgb(this.name)
					}
				case 'HSL':
					return {
						name: converter.hsl.hex(source.input),
						rgb: converter.hsl.rgb(source.input)
					}
				case 'HSV':
					return {
						name: converter.hsv.hex(source.input),
						rgb: converter.hsv.rgb(source.input)
					}
				case 'HWB':
					return {
						name: converter.hwb.hex(source.input),
						rgb: converter.hwb.rgb(source.input)
					}
				case 'SGR':
					return {
						name: source.input,
						rgb: source.input
					}
				case 'named':
					return {
						name: converter.keyword.hex(source.input),
						rgb: converter.keyword.rgb(source.input)
					}
				default:
					throw new Error(`Unrecognised color space: ${source.space}`)
			}
		})(this.source)
github thebespokepixel / trucolor / lib / index-es.js View on Github external
rgb: converter.hex.rgb(this.name)
					}
				case 'HSL':
					return {
						name: converter.hsl.hex(source.input),
						rgb: converter.hsl.rgb(source.input)
					}
				case 'HSV':
					return {
						name: converter.hsv.hex(source.input),
						rgb: converter.hsv.rgb(source.input)
					}
				case 'HWB':
					return {
						name: converter.hwb.hex(source.input),
						rgb: converter.hwb.rgb(source.input)
					}
				case 'SGR':
					return {
						name: source.input,
						rgb: source.input
					}
				case 'named':
					return {
						name: converter.keyword.hex(source.input),
						rgb: converter.keyword.rgb(source.input)
					}
				default:
					throw new Error(`Unrecognised color space: ${source.space}`)
			}
		})(this.source)
github thebespokepixel / trucolor / src / lib / classes / interpreter.js View on Github external
name: converter.rgb.hex(source.input),
						rgb: converter.hex.rgb(this.name)
					}
				case 'HSL':
					return {
						name: converter.hsl.hex(source.input),
						rgb: converter.hsl.rgb(source.input)
					}
				case 'HSV':
					return {
						name: converter.hsv.hex(source.input),
						rgb: converter.hsv.rgb(source.input)
					}
				case 'HWB':
					return {
						name: converter.hwb.hex(source.input),
						rgb: converter.hwb.rgb(source.input)
					}
				case 'SGR':
					return {
						name: source.input,
						rgb: source.input
					}
				case 'named':
					return {
						name: converter.keyword.hex(source.input),
						rgb: converter.keyword.rgb(source.input)
					}
				default:
					throw new Error(`Unrecognised color space: ${source.space}`)
			}
		})(this.source)