Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions __TESTS__/unit/actions/Overlay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {Format, png} from "../../../src/values/format";
import {Underlay} from "../../../src/actions/underlay";
import {Timeline} from "../../../src/values/timeline";
import {base64Encode} from "../../../src/internal/utils/base64Encode";
import {TextStyle} from "../../../src/values/textStyle";

describe('Tests for overlay actions', () => {
it('Tests Image on Image with publicID encoding', () => {
Expand Down Expand Up @@ -82,6 +83,18 @@ describe('Tests for overlay actions', () => {
expect(asset.toString()).toBe(`b_red,co_blue,l_text:${textStyle.toString()}:Testing/fl_layer_apply`);
});

it('Tests text on image with RGB backgroundColor', () => {
const asset = createNewImage();

asset.overlay(Overlay.source(
Source.text('Testing', new TextStyle('arial', 15))
.backgroundColor('#FEB61FC2')
.textColor('blue')
));

expect(asset.toString()).toBe(`b_rgb:FEB61FC2,co_blue,l_text:arial_15:Testing/fl_layer_apply`);
});

it('Tests nested subtitles on image', () => {
const asset = createNewImage();
const textStyle = sampleTextStyle();
Expand Down
2 changes: 1 addition & 1 deletion src/values/source/sourceTypes/BaseTextSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BaseTextSource extends BaseSource {

tmpAction.addQualifier(new Qualifier(layerType, layerParam));
this._textColor && tmpAction.addQualifier(new Qualifier('co', prepareColor(this._textColor)));
this._backgroundColor && tmpAction.addQualifier(new Qualifier('b', this._backgroundColor));
this._backgroundColor && tmpAction.addQualifier(new Qualifier('b', prepareColor(this._backgroundColor)));

return tmpAction.toString();
}
Expand Down