Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Las diapositivas de AppScript obtienen el código hexadecimal del cuadro de texto

Para Apps Script, intento imprimir el código hexadecimal del cuadro de texto de relleno. Algunas ideas. Estoy atascado una vez que llego a .getSolidFill() . Esta línea no me funciona: shape.getFill().getSolidFill().getColor().asRgbColor().asHexString())

 function adjustFillColor() { // // Open the presentation and get the slides in it. let deck = SlidesApp.openById(masterDeckID); let slides = deck.getSlides(); let masterSlide = slides[1]; let slide = masterSlide.duplicate(); slide.getShapes().forEach(shape => { // Iterate through every shape in the slide if (shape.getFill().getSolidFill()!== null){ shape.getFill().setSolidFill("#000000"); } }); };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En su guión, ¿qué tal la siguiente modificación?

De:

 console.log("Color String: " +shape.getFill().getSolidFill());

A:

 console.log("Color String: " + shape.getFill().getSolidFill().getColor().asRgbColor().asHexString());
  • Cuando se ejecuta este script modificado, puede recuperar el color de las formas como el valor HEX.

  • O, ¿qué tal la siguiente modificación?

    • De

       slide.getShapes().forEach(shape => { if (shape.getFill().getSolidFill()!== null) console.log("Color String: " +shape.getFill().getSolidFill());
    • A

       masterSlide.getShapes().forEach(shape => { var solidFill = shape.getFill().getSolidFill(); var color = solidFill && solidFill.getColor(); var rgbColor = color && color.getColorType() == SlidesApp.ColorType.RGB ? color.asRgbColor() : null; if (solidFill && color && rgbColor) { console.log("Color String: " + rgbColor.asHexString()); } });

Referencias:

  • obtenerRellenoSólido()
  • obtenerColor()
  • comoRgbColor()
  • comoHexString()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!