Spanish Total.js
English
Documentation For AI agents
Contents

Read colours from a file or a text

Bring the colours that you already have in a style sheet, a palette of a drawing program or a list, without typing them one by one.

.md GitHub
On this page

From a file

Press the folder next to Palettes, and choose the file. TotalColor makes a new palette with the colours that it finds. The palette has the name that the file gives itself, if it is a GPL palette, or the name of the file.

You can choose files that end in .gpl, .css, .scss, .less, .json, .txt, .svg and .html, of 2 MB at most.

From a text

  1. Open the palette where the colours go.
  2. Press Read from text…, and paste the text. The colours found show below it.
  3. Press the button that says how many there are, for example Keep 5 colours.

The colours that the palette already has are not added again. If you have no palette, press Keep this colour or make one first.

What is read

  • In a palette of GIMP, every colour with its name.
  • In any other text, the colours written with # and three, six or eight digits (#FA0, #9AD959, #9AD95980), and those written as rgb(…), hsl(…) and oklch(…), when the whole colour is on one line.
Names such as red are not read from a file or a text, nor colours with a variable inside, such as rgb(var(--x)).

The names

When a line has one colour, the rest of the line is its name. So --brand: #9ad959; gives a colour called brand, and #9AD959 Green one called Green.

From JSON, the name is the one before the colour: "green": "#9ad959" gives green. A line with several colours gives them without names: name them after.

Each colour is kept once, with the first name that it has in the text.

Made in Europe