Add a new option to control whether to render inline color box or not.

This commit is contained in:
rebornix
2017-08-16 17:05:12 -07:00
committed by Peng Lyu
parent deb0bd5858
commit f52299aee0
12 changed files with 46 additions and 269 deletions

View File

@@ -474,6 +474,7 @@ export interface IRawColorInfo {
color: [number, number, number, number];
availableFormats: (number | [number, number])[];
range: IRange;
renderDecorator: boolean;
}
export type IRawColorFormatMap = [number, string][];

View File

@@ -734,7 +734,8 @@ class ColorProviderAdapter {
return {
color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha] as [number, number, number, number],
availableFormats: availableFormats,
range: TypeConverters.fromRange(ci.range)
range: TypeConverters.fromRange(ci.range),
renderDecorator: ci.renderDecorator
};
});

View File

@@ -1056,7 +1056,9 @@ export class ColorRange {
availableFormats: IColorFormat[];
constructor(range: Range, color: Color, availableFormats: IColorFormat[]) {
renderDecorator: boolean;
constructor(range: Range, color: Color, availableFormats: IColorFormat[], renderDecorator: boolean) {
if (color && !(color instanceof Color)) {
throw illegalArgument('color');
}
@@ -1069,6 +1071,7 @@ export class ColorRange {
this.range = range;
this.color = color;
this.availableFormats = availableFormats;
this.renderDecorator = renderDecorator;
}
}