Skip to content

Commit

Permalink
ref: ApiRGBColorToJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Yar04ek committed Dec 1, 2023
1 parent 0c80f9a commit 1a311da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/docx/smoke/api_rgb_color/to_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builder.CreateFile("docx");
oDocument.Push(oParagraph1);
let oParagraph2 = Api.CreateParagraph();
let oGs1 = Api.CreateGradientStop(oRGBColor, 0);
let oGs2 = Api.CreateGradientStop(oRGBColor, 10);
let oGs2 = Api.CreateGradientStop(255, 213, 191, 100000);
let oFill = Api.CreateLinearGradientFill([oGs1, oGs2], 5400000);
let oStroke = Api.CreateStroke(0, Api.CreateNoFill());
let oDrawing = Api.CreateShape("rect", 5930900, 395605, oFill, oStroke);
Expand Down
10 changes: 5 additions & 5 deletions spec/docx/smoke/api_rgb_color_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

it 'ApiRGBColor | ToJSON method' do
docx = builder.build_and_parse('js/docx/smoke/api_rgb_color/to_json.js')
rgba = JSON.parse(docx.elements[1].nonempty_runs.first.text)
lst = rgba['graphic']['spPr']['fill']['fill']['gsLst'][1]['color']['color']['rgba']
expect(lst['red']).to eq(255)
expect(lst['green']).to eq(111)
expect(lst['blue']).to eq(61)
json = JSON.parse(docx.elements[1].nonempty_runs.first.text)
rgba = json['graphic']['spPr']['fill']['fill']['gsLst'][0]['color']['color']['rgba']
expect(rgba['red']).to eq(255)
expect(rgba['green']).to eq(111)
expect(rgba['blue']).to eq(61)
end
end

0 comments on commit 1a311da

Please sign in to comment.