Get a Slide Color Scheme Introduction
Theme colors contain text and background colors, accent colors, and hyperlink colors. With Aspose.Slides Cloud, you can use the following API method to read information of a slide color scheme from a PowerPoint presentation.
GetColorScheme
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/theme/colorScheme
GET
Retrieves a color scheme from a presentation slide.
GetColorScheme
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
slideIndex
integer
path
true
The 1-based index of the slide.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Read information of the color scheme of the first slide from the document MyFolder/MyPresentation.pptx saved to the default storage.
cURL Solution
Request
Get an Access Token
Copy curl -X POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=MyClientId&client_secret=MyClientSecret" \
-H "Content-Type: application/x-www-form-urlencoded"
Read the Color Scheme
Copy curl -X GET "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/theme/colorScheme?folder=MyFolder" \
-H "authorization: Bearer MyAccessToken"
Response
Response Example
Copy {
"accent1" : "#FFE48312" ,
"accent2" : "#FFBD582C" ,
"accent3" : "#FF865640" ,
"accent4" : "#FF9B8357" ,
"accent5" : "#FFC2BC80" ,
"accent6" : "#FF94A088" ,
"dark1" : "#FF000000" ,
"dark2" : "#FF637052" ,
"followedHyperlink" : "#FF8C8C8C" ,
"hyperlink" : "#FF2998E3" ,
"light1" : "#FFFFFFFF" ,
"light2" : "#FFCCDDEA" ,
"selfUri" : {
"href" : "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/slides/1/theme/colorScheme?folder=MyFolder" ,
"relation" : "self" ,
"slideIndex" : 1
}
}
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System ;
class Application
{
static void Main ( )
{
var slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
var colorScheme = slidesApi . GetColorScheme ( "MyPresentation.pptx" , 1 , null , "MyFolder" );
Console . WriteLine ( "Hyperlink color: " + colorScheme . Hyperlink );
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
ColorScheme colorScheme = slidesApi . getColorScheme ( "MyPresentation.pptx" , 1 , null , "MyFolder" , null );
System . out . println ( "Hyperlink color: " + colorScheme . getHyperlink ());
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$colorScheme = $slidesApi -> getColorScheme ( "MyPresentation.pptx" , 1 , null , "MyFolder" );
echo "Hyperlink color: " , $colorScheme -> getHyperlink ();
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
color_scheme = slides_api . get_color_scheme ( "MyPresentation.pptx" , 1 , nil , "MyFolder" )
print "Hyperlink color: " , color_scheme . hyperlink
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
color_scheme = slides_api . get_color_scheme ( "MyPresentation.pptx" , 1 , None , "MyFolder" )
print ( "Hyperlink color:" , color_scheme . hyperlink )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
slidesApi . getColorScheme ( "MyPresentation.pptx" , 1 , null , "MyFolder" ). then ( colorScheme => {
console . log ( "Hyperlink color:" , colorScheme . body . hyperlink );
});
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = std :: make_shared < SlidesApi > ( L "MyClientId" , L "MyClientSecret" );
auto colorScheme = slidesApi -> getColorScheme ( L "MyPresentation.pptx" , 1 , L "" , L "MyFolder" ). get ();
std :: wcout << "Hyperlink color: " << colorScheme -> getHyperlink ();
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my %parameters = ( name => "MyPresentation.pptx" , slide_index => 1 , folder => "MyFolder" );
my $color_scheme = $slides_api -> get_color_scheme ( %parameters );
print "Hyperlink color: " , $color_scheme -> { hyperlink };
Swift
Go
SDKs
Check Available SDKs to learn how to add an SDK to your project.