@@ -70,6 +70,32 @@ When you choose a file from the file input, it will trigger `fileChangeEvent`.
70
70
That event is then passed to the image cropper through ` imageChangedEvent ` which will load the image into the cropper.
71
71
Everytime you release the mouse, the ` imageCropped ` event will be triggered with the cropped image as a Base64 string in its payload.
72
72
73
+ #### Example of customize colors
74
+ Add class to the image-cropper in your HTML:
75
+ ``` html
76
+ <image-cropper class =" cropper-custom-colors"
77
+ ...
78
+ ></image-cropper >
79
+ ```
80
+ Add the variables that you need to your scss:
81
+ ``` scss
82
+ .cropper-custom-colors {
83
+ --cropper-overlay-color : blueviolet ;
84
+ --cropper-outline-color : rgba (255 , 192 , 203 , 0.514 );
85
+ --cropper-color : white ;
86
+ --cropper-border : 1px dashed yellow ;
87
+ --cropper-border-color-hf : deeppink ;
88
+ --cropper-border-width-hf : 3px ;
89
+ --cropper-square : green ;
90
+ --cropper-square-border : 1px solid red ;
91
+ --cropper-square-hf : green ;
92
+ --cropper-square-border-hf : 1px solid red ;
93
+ }
94
+ ```
95
+ ![ cropper-custom-colors-example] ( customize-colors.png )
96
+
97
+ * Review the variables described in API > CSS Variables section.
98
+
73
99
## Alternatives
74
100
75
101
### If you find ngx-image-cropper doesn't cover your needs we recommend taking a look at Pintura
@@ -121,10 +147,18 @@ All inputs are optional. Either the `imageChangedEvent`, `imageBase64` or `image
121
147
| ` options ` | Partial<CropperOptions > | undefined | Provide more options at once instead of using the individual inputs. The options passed using this input will be applied as a patch. If you pass ` {canvasRotation: 3} ` and then ` {} ` , this will not reset the ` canvasRotation ` . To reset it, you should pass ` {canvasRotation: 0} ` . |
122
148
123
149
### CSS Variables
124
- | Name | Type | Default | Description |
125
- | ----------------------------| -----------| -----------------------| -------------------------------------------------|
126
- | ` --cropper-outline-color ` | string | rgba(255,255,255,0.3) | The background color you see around the cropper |
127
- | ` --cropper-overlay-color ` | string | rgba(255,255,255) | The background color you see around the image |
150
+ | Name | Type | Default | Description |
151
+ | ------------------------------| -----------| ------------------------------------| ----------------------------------------------------------------------|
152
+ | ` --cropper-outline-color ` | string | rgba(255,255,255,0.3) | The background color you see around the cropper |
153
+ | ` --cropper-overlay-color ` | string | rgba(255,255,255) | The background color you see around the image |
154
+ | ` --cropper-color ` | string | #53535C | The color you see in the cropping selection |
155
+ | ` --cropper-border ` | string | 1px solid rgba(255, 255, 255, 0.5) | The border you see in the cropping selection |
156
+ | ` --cropper-border-color-hf ` | string | dodgerblue | The color when hover or focus the cropping selection |
157
+ | ` --cropper-border-width-hf ` | string | 2px | The size of border when hover or focus the cropping selection |
158
+ | ` --cropper-square ` | string | #53535C | The color of the squares to resize cropping selection |
159
+ | ` --cropper-square-border ` | string | 1px solid rgba(255, 255, 255, 0.5) | The border of the squares to resize cropping selection |
160
+ | ` --cropper-square-hf ` | string | #53535C | The color of the squares when hover or focus the cropping selection |
161
+ | ` --cropper-square-border-hf ` | string | 1px solid rgba(255, 255, 255, 0.5) | The border of the squares when hover or focus the cropping selection |
128
162
129
163
### Outputs
130
164
| Name | Type | Description |
0 commit comments