How to simplify Hexadecimal code #ff6a00

Asked

Viewed 154 times

-2

I need to simplify this hexadecimal code #ff6a00, is there a rule ? has some formula ?

  • 3

    Define simplify.

  • A smaller number for the same color!

  • for the top tag I’m testing this #F60 or # f6a0

  • 2

    #f6a0 is an invalid format for color setting, or 8 bits per color (#RRGGBB) or 4 (#RGB). Maybe it’s interpreted as (#RGBA), which would make the colour transparent (alpha = 0)

  • 6

    What is the use of having a slightly smaller code?

2 answers

2

TL;DR: There’s no way to simplify.

Long version:

  • In long hexadecimal notation this is not possible, since it is the original format used in the question (#RRGGBB).
  • In short hexadecimal notation (#RGB) this is not possible, since it is the format of the green component (#6a) cannot be simplified without loss of color resolution. Next versions: #f60 or #f70.
  • In LESS you can set a short alias for the color.

LESS EXAMPLE:

@o: #ff6a00; 
#title { color: @o; }

Still, the compiled version will present the full content:

#title { color: #ff6a00; }

1


One way to simplify would be to replace the hexadecimal code of the color by the name of the same table has the names and hexadecimal codes of each color.

Example: background-color: #ADFF2F has the same effect as background-color: Greenyellow

Just look for the nearest color to the hexadecimal code mentioned and replace it with the name of the color in question.

  • But GreenYellow has more characters than #ADFF2F

  • 3

    I thought when he talks about simplifying he was referring to the syntax aiming to facilitate the use of a color and not with respect to the amount of characters.

  • Is that he explains it in the comments.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.