Use the shared color blend helper from SWT
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #4489 de @vogella — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- desktop-dev, frontend
Línea de trabajo
Start with org.eclipse.jface.resource.JFaceColors and the existing private blend copies listed in the issue, such as PopupDialog.blend and Colors.blend. The open question is the ratio type, which the issue leaves undecided, so the design needs maintainer input. A pull request (#4489) is already open against this issue, so check its state and discussion before starting. Done means one public RGB blend in JFaceColors with the public Forms and Workbench versions delegating to it, and no color shift.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Blending two RGB values by a ratio is implemented over a dozen times in platform.ui, each with its own parameter type and rounding.
Following the discussion in #4489, SWT now provides the shared helper: RGB.blend(RGB other, double weight) and RGBA.blend(RGBA other, double weight) (eclipse-platform/eclipse.platform.swt#3732, @since 3.136).
The weight is the share of other, from 0 (the receiver) to 1 (other), and channels are rounded to the nearest integer.
Work to do in platform.ui, once SWT 3.136 is in the target platform:
- Raise the
org.eclipse.swtlower bound to 3.136 in each touched bundle'sMANIFEST.MF. - Replace the private copies with
RGB.blend:
| Bundle | Copy | Replacement |
|---|---|---|
| jface | PopupDialog.blend(bg, fg, factor) |
bg.blend(fg, factor) |
| jface.databinding | SWTUtil.mix(rgb1, rgb2, ratio) |
rgb2.blend(rgb1, ratio) |
| jface.text | Colors.blend(bg, fg, factor), projection SourceViewerInformationControl.blend |
bg.blend(fg, factor) |
| jface.text | OverviewRuler.interpolate(fg, bg, scale), DiffPainter.interpolate |
fg.blend(bg, scale) |
| ui.editors | SourceViewerInformationControl.blend(bg, fg, factor) |
bg.blend(fg, factor) |
| ui.workbench | ShowViewDialog.blend(c1, c2, ratio) |
c2.blend(c1, ratio / 100.0) |
| ui.workbench | HeapStatus.blend(fg, bg) (40% foreground) |
bg.getRGB().blend(fg.getRGB(), 0.4) |
| e4 renderers | CTabRendering.blend(c1, c2, ratio) |
c2.blend(c1, ratio / 100.0) |
- Keep the public API and let it delegate:
FormColors.blend(c1, c2, ratio)andColorUtil.blend(c1, c2, ratio)becomec2.blend(c1, ratio / 100.0), andColorUtil.blend(val1, val2)becomesval1.blend(val2, 0.5).
The copies truncate while RGB.blend rounds, so a migrated color can differ by one per channel.
Tests that compare exact RGB values need adjusting rather than a rounding shim.
Copies in other repositories (Compare in eclipse.platform, JDT UI, PDE, GEF Classic's FigureUtilities) can follow the same way.
- Lenguaje dominante
- Java
- Estrellas
- 124
- Forks
- 269
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 69
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eclipse-platform/eclipse.platform.ui
-
Theme controls do not show/hide when the checkbox is toggledPosiblemente ocupada @nburnwal09 la tomó hace 2 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
eclipse-platform/eclipse.platform.ui#4502 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eclipse-platform/eclipse.platform.ui#4125 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.ui#4016 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.ui#3892 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
eclipse-platform/eclipse.platform.ui#2687 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.ui
Issues similares
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the appPosiblemente ocupada @falkloewert la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
oracle/graalvm-reachability-metadata#11026 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
CodeForPhilly/benefit-decision-toolkit#565 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
checkstyle/checkstyle#22050 · 1 comentario ·
Los mantenedores suelen responder en 1 día