mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
color api: remove ColorRange.format
This commit is contained in:
@@ -467,7 +467,6 @@ export abstract class ExtHostHeapServiceShape {
|
||||
}
|
||||
export interface IRawColorInfo {
|
||||
color: [number, number, number, number | undefined];
|
||||
format: number;
|
||||
availableFormats: number[];
|
||||
range: IRange;
|
||||
}
|
||||
|
||||
@@ -706,12 +706,10 @@ class ColorProviderAdapter {
|
||||
if (Array.isArray(colors)) {
|
||||
const colorInfos: IRawColorInfo[] = [];
|
||||
colors.forEach(ci => {
|
||||
const format = getCachedId(ci.format);
|
||||
const availableFormats = ci.availableFormats.map(f => getCachedId(f));
|
||||
|
||||
colorInfos.push({
|
||||
color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha],
|
||||
format: format,
|
||||
availableFormats: availableFormats,
|
||||
range: TypeConverters.fromRange(ci.range)
|
||||
});
|
||||
|
||||
@@ -1045,17 +1045,12 @@ export class ColorRange {
|
||||
|
||||
color: Color;
|
||||
|
||||
format: IColorFormat;
|
||||
|
||||
availableFormats: IColorFormat[];
|
||||
|
||||
constructor(range: Range, color: Color, format: IColorFormat, availableFormats: IColorFormat[]) {
|
||||
constructor(range: Range, color: Color, availableFormats: IColorFormat[]) {
|
||||
if (color && !(color instanceof Color)) {
|
||||
throw illegalArgument('color');
|
||||
}
|
||||
if (format && (typeof format !== 'string') && !format.opaque && !format.transparent && typeof format.opaque !== 'string' && typeof format.transparent !== 'string') {
|
||||
throw illegalArgument('format');
|
||||
}
|
||||
if (availableFormats && !Array.isArray(availableFormats)) {
|
||||
throw illegalArgument('availableFormats');
|
||||
}
|
||||
@@ -1064,7 +1059,6 @@ export class ColorRange {
|
||||
}
|
||||
this.range = range;
|
||||
this.color = color;
|
||||
this.format = format;
|
||||
this.availableFormats = availableFormats;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user