<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>idea Batch add colors to ArcGIS Pro style in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idi-p/1529511</link>
    <description>&lt;P&gt;Currently I have to enter color values manually to an ArcGIS Pro Style (.stylx), which is time consuming and laborious. I suggest the ability to add colors to an ArcGIS Pro style with a batch process or as a file. I envision something similar to the process of adding swatch files (.ase) to Adobe Illustrator. Alternatively the user could prepare a .csv with HEX, RGB, CMYK values, etc., color mode, and the other field values in Catalog that must currently be entered manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113855i4A0854D0A6ABA709/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM.PNG" alt="Screen Shot 08-29-24 at 09.37 AM.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.35 AM.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113856i1C27B5B0924C44A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.35 AM.PNG" alt="Screen Shot 08-29-24 at 09.35 AM.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM 001.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113857i85CFDECD803216AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM 001.PNG" alt="Screen Shot 08-29-24 at 09.37 AM 001.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM 002.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113859i8BCFE48CA2CF5198/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM 002.PNG" alt="Screen Shot 08-29-24 at 09.37 AM 002.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.38 AM.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113858iF3898911437DC282/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.38 AM.PNG" alt="Screen Shot 08-29-24 at 09.38 AM.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 15:43:59 GMT</pubDate>
    <dc:creator>FourCornersMapping</dc:creator>
    <dc:date>2024-08-29T15:43:59Z</dc:date>
    <item>
      <title>Batch add colors to ArcGIS Pro style</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idi-p/1529511</link>
      <description>&lt;P&gt;Currently I have to enter color values manually to an ArcGIS Pro Style (.stylx), which is time consuming and laborious. I suggest the ability to add colors to an ArcGIS Pro style with a batch process or as a file. I envision something similar to the process of adding swatch files (.ase) to Adobe Illustrator. Alternatively the user could prepare a .csv with HEX, RGB, CMYK values, etc., color mode, and the other field values in Catalog that must currently be entered manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113855i4A0854D0A6ABA709/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM.PNG" alt="Screen Shot 08-29-24 at 09.37 AM.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.35 AM.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113856i1C27B5B0924C44A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.35 AM.PNG" alt="Screen Shot 08-29-24 at 09.35 AM.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM 001.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113857i85CFDECD803216AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM 001.PNG" alt="Screen Shot 08-29-24 at 09.37 AM 001.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.37 AM 002.PNG" style="width: 371px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113859i8BCFE48CA2CF5198/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.37 AM 002.PNG" alt="Screen Shot 08-29-24 at 09.37 AM 002.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 08-29-24 at 09.38 AM.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113858iF3898911437DC282/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 08-29-24 at 09.38 AM.PNG" alt="Screen Shot 08-29-24 at 09.38 AM.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 15:43:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idi-p/1529511</guid>
      <dc:creator>FourCornersMapping</dc:creator>
      <dc:date>2024-08-29T15:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Batch add colors to ArcGIS Pro style</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idc-p/1535477#M32000</link>
      <description>&lt;P&gt;I agree this would be very useful! I found &lt;A href="https://community.esri.com/t5/arcgis-pro-documents/how-to-programatically-add-symbols-to-a-stylx/ta-p/921159" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; a while back, it seems that this can be done with python, but I never figured it out myself.&amp;nbsp; Seeing your post inspired me to take another stab at it.&amp;nbsp; If you update the path to your stylx file and your spreadsheet, something like this should work for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sqlite3
import pandas as pd
import json

# Connect to stylx file (tested this on a copy of favorites)
stylx_file = r"C:\Users\username\AppData\Roaming\Esri\ArcGISPro\Favorites - Copy.stylx"
conn = sqlite3.connect(stylx_file)
cursor = conn.cursor()

# Get the items table
cursor.execute("SELECT * FROM Items LIMIT 1000;")
items = cursor.fetchall()
new_id = len(items)+1

# Load in your colors, assuming you have a spreadsheet with the referenced fields
excel_file = r"C:\Users\username\AppData\Roaming\Esri\ArcGISPro\addColors.xlsx"
df = pd.read_excel(excel_file)
df.fillna('', inplace=True)

# Loop through and insert rows
for row in df.itertuples():
    content = {'type':'CIMCMYKColor','values':[row.C, row.M, row.Y, row.K,100-row.alpha]}
    new_row = (new_id,1,row.Category,row.Name,row.Tags,json.dumps(content))
    cursor.execute('INSERT INTO ITEMS(ID, CLASS, CATEGORY, NAME, TAGS, CONTENT) VALUES(?,?,?,?,?,?)', new_row)
    new_id += 1

# save and close
conn.commit()
conn.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 14:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idc-p/1535477#M32000</guid>
      <dc:creator>BrennanSmith1</dc:creator>
      <dc:date>2024-09-05T14:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Batch add colors to ArcGIS Pro style</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idc-p/1535485#M32001</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/39515"&gt;@BrennanSmith1&lt;/a&gt;&amp;nbsp;That's great! I'll check it out! Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 14:21:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/batch-add-colors-to-arcgis-pro-style/idc-p/1535485#M32001</guid>
      <dc:creator>FourCornersMapping</dc:creator>
      <dc:date>2024-09-05T14:21:38Z</dc:date>
    </item>
  </channel>
</rss>

