mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Add rgba format
This commit is contained in:
@@ -95,6 +95,16 @@ export namespace color {
|
||||
export namespace css {
|
||||
export function toColor(css: string): IColor {
|
||||
switch (css.length) {
|
||||
case 5: // #rgba
|
||||
return {
|
||||
css,
|
||||
rgba: channels.toRgba(
|
||||
parseInt(css.substr(1, 2), 16),
|
||||
parseInt(css.substr(3, 2), 16),
|
||||
parseInt(css.substr(5, 2), 16),
|
||||
parseInt(css.substr(7, 2), 16)
|
||||
)
|
||||
};
|
||||
case 7: // #rrggbb
|
||||
return {
|
||||
css,
|
||||
|
||||
Reference in New Issue
Block a user