color api: remove ColorRange.format

This commit is contained in:
Joao Moreno
2017-08-11 11:45:52 +02:00
parent 0f5272afe9
commit 13a6a7a9c3
11 changed files with 31 additions and 52 deletions

View File

@@ -467,7 +467,6 @@ export abstract class ExtHostHeapServiceShape {
}
export interface IRawColorInfo {
color: [number, number, number, number | undefined];
format: number;
availableFormats: number[];
range: IRange;
}

View File

@@ -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)
});

View File

@@ -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;
}
}