obetame / ColorConvert

sublime text 3 plugin, support RGB2HEX & HEX2RGB and more convert mode.
7 stars 1 forks source link

feature_request(css3_colors): convert to CSS3 colors #1

Closed Kristinita closed 6 years ago

Kristinita commented 6 years ago

1. Summary

It would be nice, if would be possible convert from any format to CSS3 color names.

Example:

    from HEX to CSS3 color names:

2. Argumentation

CSS3 color names — format for humans, not for bots. I don't remember HEX, RGB and HSL of red color, but I remember, that it red.

Situations, where I need CSS3 color names:

  1. css-to-stylus (I'm sure, that another tools also) convert from CSS3 to HEX.
  2. I can copy CSS from some sites → I'm don't understand, which color I copy, because I don't know HEX/RGB/HSL codes. I need convert to CSS3 color names, that understand what colors it is.

Thanks.

obetame commented 6 years ago

This is a good idea, I will add this feature(HEX -> Css_Color_Name) in the next version.

I did not consider this feature before because the css color name is not much, only 147.

obetame commented 6 years ago

@Kristinita The latest version 2.1.0 has been released, but it cannot be installed using package control at present.

so if you really want to experience this new feature, I suggest you directly clone this library into your sublime package directory(menu->preferences->browse packages) and restart the sublime.

Thank you for using my plugin.

Kristinita commented 6 years ago

@zhouyuexie ,

Status: :exclamation: Another problem

1. Summary

It would be nice, if CSS3 color names will be in lowercase.

2. Argumentation

Default Sublime Text CSS3 syntax highlight only lowercase CSS3 color names.

3. Steps to reproduce

I select #ff0000 → I run command color_convert_hex_to_name.

4. Expected behavior

red highlight.

Expected

5. Actual behavior

Red doesn't highlight.

Red

Thanks.

Kristinita commented 6 years ago

@zhouyuexie , notes:

  1. You can make prereleases of your Sublime Text packages, example.
  2. Perhaps, for you my article will be useful — Fastest way to add new version of your Sublime Text package.

Thanks.

obetame commented 6 years ago

@Kristinita

Thank you for your feedback and guidance.

This is my first sublime package and I haven't been exposed to this kind of release process before, and I'm sorry if this bug has caused some of your other problems.

I will try to fix this issue and understand the release mechanism as soon as possible.

Kristinita commented 6 years ago

@zhouyuexie , ping.

Can you make CSS color names lowercase?

Thanks.

obetame commented 6 years ago

@Kristinita you mean?

  1. Hex->colorName, the colorName is lowercase.
  2. make all colorNames lowercase in the file.

and if someone needs colorName capitalization, then corresponds to the whole name capitalization or hum capitalization?

Kristinita commented 6 years ago

@zhouyuexie , answers:

Hex->colorName, the colorName is lowercase.

Yes, I meant it.

make all colorNames lowercase in the file.

Also, it would be nice if would be possible convert all HEX → colorName for file.

and if someone needs colorName capitalization, then corresponds to the whole name capitalization or hum capitalization?

I do not know the arguments why capitalization is needed. my opinion — if any user argues for the need for capitalization, then we can think about it.

Thanks.

obetame commented 6 years ago

@Kristinita The capitalization configuration takes into account some people’s habits, so I kept it.

A 2.2.0 version has just been updated, and colorName can be controlled by capitalization configuration.

The version adding full file conversion: Hex->colorName

Capitalization defaults to false, so you can leave it alone.

Hope you will like it.😝

Kristinita commented 6 years ago

@zhouyuexie ,

Status: :broken_heart: Partially fixed

1. Summary

HEX colors, that contains 3 symbols after hash, doesn't convert to CSS color names.

2. Configuration

Example SashaConvert.css file:

body {
    color: #fff;
    color: #ffffff;
    color: #f00;
    color: #ff0000;
}

3. Steps to reproduce

I run command color_convert_all_hex_to_name.

4. Expected behavior

body {
    color: white;
    color: white;
    color: red;
    color: red;
}

5. Actual behavior

body {
    color: #fff;
    color: white;
    color: #f00;
    color: red;
}

Thanks.

Kristinita commented 6 years ago

@zhouyuexie ,

Status: :exclamation: Another problem

1. Summary

ARGB colors incorrect convert.

2. Configuration

Example SashaARGB.css file:

body {
    color: #f0808077;
}

3. Steps to reproduce

I run command color_convert_all_hex_to_name.

4. Expected behavior

No convert ARGB:

body {
    color: #f0808077;
}

5. Actual behavior

Bug:

body {
    color: lightcoral77;
}

Thanks.

obetame commented 6 years ago

@Kristinita It has been confirmed that these problems do exist, I will immediately repair it.

Will notify you the first time after the repair is completed, thank you.

obetame commented 6 years ago

@Kristinita the new version v2.3.0 is publish.

I hope that these repairs will meet your expectations.

Kristinita commented 6 years ago

@zhouyuexie ,

Status: :exclamation: Another problem

1. Summary

ARGB colors convert to CSS color names. This should not be.

2. Argumentation

First 2 symbols in ARGB — transparency.

Example: #80FFFFFF — 50% transparency for white color

More details:

3. Data

Configuration, steps to reproduce and expected behavior as in previous section.

f0 in #f0808077 — transparency for #808077 color, not for lightcoral.

4. Actual behavior

body {
    color: lightcoral;
}

Thanks.

obetame commented 6 years ago

@Kristinita Hex containing transparency is not the same format in android and css, sorry to ignore this detail.

the new version v2.3.1 is publish.

obetame commented 6 years ago

@Kristinita The new versions 2.3.1 add config 'is_android', you should change is to 'true'.

the package.io website is break, so may need to wait for a while

Kristinita commented 6 years ago

❔ Question

Hex containing transparency is not the same format in android and css

Where I can read about it in more details?

Thanks.

obetame commented 6 years ago

css

Syntax like #RRGGBB[AA], more info: [color_value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba())

android

Syntax like #[AA]RRGGBB, more info: android color

Kristinita commented 6 years ago

@zhouyuexie,

Status: :x: Still doesn't work for me

Example:

If user wrote #ff000080, it means that he want red color with 50% transparency, not just red. #ff000080 not must convert to red, because in red no transparency.

Thanks.

obetame commented 6 years ago

My fault, I thought you need this conversion....

Will notify you the first time after the repair is completed.

obetame commented 6 years ago

@Kristinita Version 2.3.3 has been released.

Major increase loss_transparent setting, does not allow the loss of transparency in hex_to_colorname conversion by default.

obetame commented 6 years ago

@Kristinita Version 2.3.3 has been released.

Major increase loss_transparent setting, does not allow the loss of transparency in hex_to_colorname conversion by default.

Kristinita commented 6 years ago

Status: :heavy_check_mark: Fixed for me

Thanks.