/********************************************************************************
 * Copyright (C) 2019 TypeFox and others.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 ********************************************************************************/ /**
 * Either be a reference to an existing color or a color value as a hex string, rgba, or hsla.
 */ export type Color = string | RGBA | HSLA | ColorTransformation ; export namespace Color { export function rgba ( r , g , b , a = 1 ) { return { r , g , b , a } ; } export function hsla ( h , s , l , a = 1 ) { return { h , s , l , a } ; } export const white = rgba ( 255 , 255 , 255 , 1 ) ; export const black = rgba ( 0 , 0 , 0 , 1 ) ; export function transparent ( v , f ) { return { v , f , kind : 'transparent' } ; } export function lighten ( v , f ) { return { v , f , kind : 'lighten' } ; } export function darken ( v , f ) { return { v , f , kind : 'darken' } ; } } export interface ColorTransformation { kind : 'transparent' | 'lighten' | 'darken' ; v : string ; f : number ; } export interface RGBA { /**
     * Red: integer in [0-255]
     */ readonly r : number ; /**
     * Green: integer in [0-255]
     */ readonly g : number ; /**
     * Blue: integer in [0-255]
     */ readonly b : number ; /**
     * Alpha: float in [0-1]
     */ readonly a : number ; } export interface HSLA { /**
     * Hue: integer in [0, 360]
     */ readonly h : number ; /**
     * Saturation: float in [0, 1]
     */ readonly s : number ; /**
     * Luminosity: float in [0, 1]
     */ readonly l : number ; /**
     * Alpha: float in [0, 1]
     */ readonly a : number ; } export interface ColorDefaults { light ? : Color ; dark ? : Color ; hc ? : Color ; } export interface ColorDefinition { id : string ; defaults ? : ColorDefaults ; description : string ; } export interface ColorCssVariable { name : string ; value : string ; }