zTrap / compose-color-preview-plugin

Compose color preview plugin for JetBrains IDE family

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin version

Preview Compose color preview plugin for JetBrains IDE family

This plugin draws colors on editor's gutter and code completion popup. You can modify them by clicking on the icons in the gutter

It works with androidx.compose.ui.graphics.Color from Jetpack Compose or Compose Multiplatform

Features

  • Show preview in code completion popup for simple constant fields
  • Show preview in places simple constant fields usage with type Color
  • Show preview for results of compositeOver, copy, convert and lerp functions
  • Show preview in Color creation places
    • ULong constructor
    • Long function "constructor"
    • Int function "constructor"
    • Int x3 function "constructor"
    • Float x3 function "constructor"
    • Float x3 with color scheme function "constructor"
    • Float x4 function "constructor"
    • Float x4 with color scheme function "constructor"
    • hsl "constructor"
    • hsv "constructor"
  • Show palette by clicking on preview to change color
    • Change color with saving original numeral system

Preview1 Preview2

Installation

Install it from the Jetbrains plugin repository within your IDE (recommended):

  • Settings/Preferences > Plugins > Marketplace > Search 'Compose Color Preview'

You can also download the JAR package from the Jetbrains plugin repository or from GitHub Releases and add it manually to your plugins:

  • Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

FAQ

I have a duplicate preview in the color declaration line in Android Studio. How to fix it?
You can simply disable one of the previews. Go to Settings/Preferences > Editor > General > Gutter Icons and disable "Compose color picker" from "Jetpack compose" section or "Color chooser" from "Compose Color Preview" section

Starting from IDEA 2024.1 colors list order in popup is reversed. Can you fix it?
Unfortunately, no. It's Intellij IDEA Platform bug and the issue is created. So we can only wait for a fix from JetBrains

Hex in color picker have wrong pattern. Can you fix it?
Yes, but it requires a complete rewrite of the color picker popup which is not what I want to do. A request for this feature has been submitted to JetBrains, and we need to wait for a reaction

Contribution

Contributions are welcome. Please check CONTRIBUTING.md for more information.

Besides source code contributions, feel free to open bug reports or just suggest new features here.

License

Copyright 2023-2024 Peter Gulko (zTrap)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Compose color preview plugin for JetBrains IDE family

License:Apache License 2.0


Languages

Language:Kotlin 100.0%