mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Remove webgl dependence on DEFAULT_ANSI_COLORS
This commit is contained in:
@@ -17,7 +17,7 @@ export function generateConfig(scaledCharWidth: number, scaledCharHeight: number
|
||||
selection: null,
|
||||
// For the static char atlas, we only use the first 16 colors, but we need all 256 for the
|
||||
// dynamic character atlas.
|
||||
ansi: colors.ansi.slice(0, 16)
|
||||
ansi: colors.ansi.slice()
|
||||
};
|
||||
return {
|
||||
devicePixelRatio: window.devicePixelRatio,
|
||||
|
||||
@@ -11,7 +11,6 @@ import { is256Color } from './CharAtlasUtils';
|
||||
import { clearColor } from './CharAtlasGenerator';
|
||||
import { DEFAULT_ATTR } from '../../../core/buffer/BufferLine';
|
||||
import { DEFAULT_COLOR } from '../../../common/Types';
|
||||
import { DEFAULT_ANSI_COLORS } from '../../../ui/ColorManager';
|
||||
import { IColor } from 'xterm';
|
||||
|
||||
// In practice we're probably never going to exhaust a texture this large. For debugging purposes,
|
||||
@@ -158,10 +157,10 @@ export default class WebglCharAtlas extends BaseCharAtlas {
|
||||
}
|
||||
|
||||
private _getColorFromAnsiIndex(idx: number): IColor {
|
||||
if (idx < this._config.colors.ansi.length) {
|
||||
return this._config.colors.ansi[idx];
|
||||
if (idx >= this._config.colors.ansi.length) {
|
||||
throw new Error('No color found for idx ' + idx);
|
||||
}
|
||||
return DEFAULT_ANSI_COLORS[idx];
|
||||
return this._config.colors.ansi[idx];
|
||||
}
|
||||
|
||||
private _getBackgroundColor(bg: number): IColor {
|
||||
|
||||
@@ -16,7 +16,7 @@ const DEFAULT_SELECTION = {
|
||||
|
||||
// An IIFE to generate DEFAULT_ANSI_COLORS. Do not mutate DEFAULT_ANSI_COLORS, instead make a copy
|
||||
// and mutate that.
|
||||
export const DEFAULT_ANSI_COLORS = (() => {
|
||||
export const DEFAULT_ANSI_COLORS: IColor[] = (() => {
|
||||
const colors = [
|
||||
// dark:
|
||||
fromHex('#2e3436'),
|
||||
|
||||
Reference in New Issue
Block a user