You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not automatically done to give you the ability to also use the `hsl()` writing style. We also don't know, if CSS will implement further color constructors in the future.
80
-
81
-
Notice that functions always convert to their respective class automatically, so doing things like
Named colors will always return a `RgbColor` instance. Using `withAlphaSupport()` will always return the respective alpha-version of a color.
96
-
97
-
Also notice that Xyz and Lab don't have Alpha-versions and will just return an `RgbaColor`-instance of the same color.
98
-
99
64
## Color conversion
100
65
101
66
Every color can be converted to every other color space instantly.
@@ -109,16 +74,51 @@ $color->getLab()->getL();
109
74
```
110
75
111
76
112
-
Supported color spaces are:
77
+
Here's a list of the supported color spaces with their respective value methods
113
78
114
-
- RGB (`getRgb()`)
79
+
- RGB (`getRgb(): RgbColor`)
80
+
-`getRed()`
81
+
-`getGreen()`
82
+
-`getBlue()`
83
+
-`withAlphaSupport(): RgbaColor`
115
84
- RGBA (`getRgba()`)
85
+
-`getRed()`
86
+
-`getGreen()`
87
+
-`getBlue()`
88
+
-`getAlpha()`
89
+
-`withoutAlphaSupport(): RgbColor`
116
90
- HSL (`getHsl()`)
91
+
-`getHue()`
92
+
-`getSaturation()`
93
+
-`getLightness()`
94
+
-`withAlphaSupport(): HslaColor`
117
95
- HSLA (`getHsla()`)
96
+
-`getHue()`
97
+
-`getSaturation()`
98
+
-`getLightness()`
99
+
-`getAlpha()`
100
+
-`withoutAlphaSupport(): HslColor`
118
101
- HSV (`getHsv()`)
102
+
-`getHue()`
103
+
-`getSaturation()`
104
+
-`getValue()`
105
+
-`withAlphaSupport(): HsvaColor`
119
106
- HSVA (`getHsva()`)
107
+
-`getHue()`
108
+
-`getSaturation()`
109
+
-`getValue()`
110
+
-`getAlpha()`
111
+
-`withoutAlphaSupport(): HsvColor`
120
112
- CIE XYZ (`getXyz()`)
113
+
-`getX()`
114
+
-`getY()`
115
+
-`getZ()`
116
+
-`withAlphaSupport(): RgbaColor`
121
117
- CIE L\*a\*b\* (`getLab()`)
118
+
-`getL()`
119
+
-`getA()`
120
+
-`getB()`
121
+
-`withAlphaSupport(): RgbaColor`
122
122
123
123
The system is designed so that you _don't need to know_ in which color space you're getting your current color in. If you want to do modifications on a color, just convert it to the color space you need prior to that.
124
124
@@ -209,11 +209,11 @@ Through the implementation of CIE XYZ, CIE L\*a\*b\* and the CIEDE2000 standard
It's not automatically done to give you the ability to also use the `hsl()` writing style. We also don't know, if CSS will implement further color constructors in the future.
479
+
480
+
Notice that functions always convert to their respective class automatically, so doing things like
Named colors will always return a `RgbColor` instance. Using `withAlphaSupport()` will always return the respective alpha-version of a color.
495
+
496
+
Also notice that Xyz and Lab don't have Alpha-versions and will just return an `RgbaColor`-instance of the same color.
497
+
498
+
463
499
# Examples, Code, Contribution, Support
464
500
465
501
If you have questions, problems with the code or you want to contribue, either consult the [examples](https://github.com/Talesoft/phim/tree/master/tests/pragmatic), the [code](https://github.com/Talesoft/phim/tree/master/src/Phim), write an [issue](https://github.com/Talesoft/phim/issues) or [send me an E-Mail](mailto:[email protected]).
0 commit comments