Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issues #389 - Change Hyperlink Color #793

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

ReimaFrgos
Copy link
Contributor

@ReimaFrgos ReimaFrgos commented Jul 6, 2020

Adds support for setting the color of a hyperlink text and resolves issues #389

Tested against demo tests and generates all successfully and error free.

No additional user settings. relies on existing text color options. Sample code below:

var slide = pptx.addSlide();

slide.addText(
  [
    { text:'Did You Know?', options:{ fontSize:48, color:pptx.SchemeColor.accent1, breakLine:true } },
    { text:'Hyperlinks', options:{ fontSize:24, breakLine:false, color:'ff0000', hyperlink: { url: "https://github.com/gitbrent/pptxgenjs", tooltip: "Visit Homepage" }
 } },
    { text:' can now be in color', options:{ fontSize:24, color:pptx.SchemeColor.accent6 } }
  ],
  { x:1, y:1, w:'80%', h:1.5, align:'center', fill:pptx.SchemeColor.background2 }
);

slide.addText('Hyperlinks can also be a whole sentence', { fontSize:24, breakLine:false, color:'0fff0f', x:1, y:3, w:'80%', h:1, align:'center', fill:pptx.SchemeColor.background2, 
 hyperlink: { url: "https://github.com/gitbrent/pptxgenjs", tooltip: "Visit Homepage" } }
);

pptx.writeFile('PptxGenJS-Sandbox-'+getTimestamp())
.then(function(fileName){ console.log('Saved! File Name: '+fileName) });

Compatibility Note for Keynote: This will not trigger any errors, but hyperlinks will remain default colors due to functional differences.

@gitbrent gitbrent self-assigned this Jul 7, 2020
@gitbrent
Copy link
Owner

This causes an issue with non-colored links - they've now become black instead of the default blue on iOS PPT.

Current build:
Screen Shot 2020-12-26 at 15 14 16

Using this patch:
Screen Shot 2020-12-26 at 15 14 23

@gitbrent gitbrent mentioned this pull request Jan 3, 2021
@gitbrent gitbrent merged commit 840fa4d into gitbrent:master Jan 3, 2021
@gitbrent
Copy link
Owner

gitbrent commented Jan 3, 2021

Thanks @ReimaFrgos !

@gitbrent gitbrent added this to the 3.4.0 milestone Jan 3, 2021
gitbrent added a commit that referenced this pull request Jan 3, 2021
gitbrent added a commit that referenced this pull request Jan 3, 2021
@IamMille
Copy link

This causes an issue with non-colored links - they've now become black instead of the default blue on iOS PPT.

Current build: Screen Shot 2020-12-26 at 15 14 16

Using this patch: Screen Shot 2020-12-26 at 15 14 23

It seems like this was not addressed before the merge?

Is there a way to set all hyperlinks to a specific color? Or do we need to set the color per individual usage basis throughout our slides?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants