Spanish Total.js
English
Documentation For AI agents
Contents

Copy a colour for your code

TotalColor writes a colour in thirteen formats at once, so you copy the one that your code, your style sheet or your design needs.

.md GitHub
On this page

Copy one

In Written as, press the line of the format. The bottom of the window says what was copied.

The formats

This is #9AD959 in each of them:

FormatText
HEX#9AD959
RGBrgb(154 217 89)
RGB, commasrgb(154, 217, 89)
HSLhsl(90 63% 60%)
OKLCHoklch(81.6% 0.172 131.3)
HSB90° 59% 85%
SwiftUIColor(red: 0.604, green: 0.851, blue: 0.349)
UIKitUIColor(red: 0.604, green: 0.851, blue: 0.349, alpha: 1)
AppKitNSColor(srgbRed: 0.604, green: 0.851, blue: 0.349, alpha: 1)
Compose, FlutterColor(0xFF9AD959)
Android XML#FF9AD959
.NETColor.FromArgb(255, 154, 217, 89)
From 0 to 10.604, 0.851, 0.349

If none is what you need, write your own.

A colour that is not solid

Every format but HSB also writes how solid the colour is. HEX gets two more digits at the end, and RGB, commas becomes rgba(154, 217, 89, 0.5).

Mark the format that you use

Press the bookmark at the end of a line to mark that format. The marked one has a tick, and it is what TotalColor copies:

  • as soon as you pick a colour, if Copy the marked one as soon as a colour is picked is on;
  • when you pick from any app;
  • with ⌘⇧C on the Mac and Ctrl+Shift+C on Windows and Linux.

Write your own format

  1. At the end of Written as, press Write it your own way…
  2. In Written, type the text as your code wants it, with words in braces where the numbers go. For example, vec4({r1}, {g1}, {b1}, {a}) copies vec4(0.604, 0.851, 0.349, 1).
  3. Look at Gives, below the field: it has the colour of now in your format. Press Keep it.

Your format is now the last line of Written as, called Yours. You copy it and mark it as any other.

WordsWhat they become
{r} {g} {b}Red, green and blue from 0 to 255
{r1} {g1} {b1}The same from 0 to 1
{a}How solid, from 0 to 1
{a255}How solid, from 0 to 255
{hex} {HEX}Six digits, small or capital, without #
{hexa} {HEXA}Eight digits, with how solid at the end
{h} {s} {l}Hue in degrees, strength and lightness in percent

The braces of your code stay as they are: { r: {r} } copies { r: 154 }.

Press Change your own way… to write another. To have none, empty the field and press Keep it. If it was the marked format, HEX is marked again.

Made in Europe