Can we change pin color of Annotation Based on RGB values - mkmapview

In my project i need to change the Pin color based on different RGB values in MKMapView, When applied RGB values it is showing Red Pin in default. Is there any other way to apply RGB values or do we need to change the image only for that. Please let me know.
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:#"MyPin"];
**annView.pinColor = [UIColor colorWithRed:132.0/255 green:191.0/255 blue:240.0/255 alpha:1.0];**
It is not working. always showing Red as default.

You can't use the customized color in mkannotationview. You can only use the Red, Green, Purple color by using this
annotationView.pinColor = MKPinAnnotationColorRed;
annotationView.pinColor = MKPinAnnotationColorPurple;
annotationView.pinColor = MKPinAnnotationColorGreen;
Otherwise use image like this
annotationView.image = [UIImage imageNamed:#"image.png"];

Related

How to set UIDatePicker background color to white in xamarin.ios for ios 14?

I am hiding a label by a UIDatePicker in a xamarin.ios app. I changed the style of the datepicker label but can't change the background to white. Here is my code:
datePickerDateFrom.Frame = lblFromDate.Frame;
datePickerDateFrom.Subviews[0].Subviews[0].SetValueForKey(UIColor.White, new NSString("backgroundColor"));
datePickerDateFrom.Subviews[0].Subviews[0].TintColor = UIColor.Black;
datePickerDateFrom.Subviews[0].Subviews[0].Layer.BorderWidth = 1;
datePickerDateFrom.Subviews[0].Subviews[0].Layer.CornerRadius = 6;
datePickerDateFrom.Subviews[0].Subviews[0].Layer.BorderColor = UIColor.FromRGB(0, 184, 212).CGColor;
datePickerDateFrom.SizeToFit();
Add(datePickerDateFrom);
And the result is:
Any other color works but if I set the color to white it remains this ash color that's why sometimes there is a color difference inside the blue border when the short date format is selected. I don't know is it possible to align the value inside the frame and specify any fixed date format(as sometimes it displays 3 letter of month name when gets larger space). For now changing the background color to white would be a great help. Thanks in advance.

Is there any way to give gradient color to normal color property in flutter?

I am using Bar Chart of fl_chart plugin. I want to give gradient color to bar graph. Below is the line where I want give color.
BarChartRodData(y: 12, color: Color(0xFF639ed1),width: 12)
But it is not possible to set gradient color to the ##color## property unless it is colors.
Is there any way to set gradient color to color property?? Please help me..
If you pass just one color, the solid color will be used, or if you pass more than one color, we use gradient mode to draw. then the gradientFrom, gradientTo and gradientColorStops
For an example ,
final List<Color> color = <Color>[];
color.add(Colors.blue[50]);
color.add(Colors.blue[100]);
color.add(Colors.blue);
final List<double> stops = <double>[];
stops.add(0.0);
stops.add(0.5);
stops.add(1.0);
Please refer https://pub.dev/documentation/fl_chart/latest/fl_chart/BarChartRodData-class.html for BarChartRodData class variables

Background color for segmented control in IOS

I have a segmented control which needs to be blue when selected, and white when unselected. Im facing problems to set the tint color when unselected, as for some reason, it always turns out to be grey.
This is what it looks like:
The blue border is actually a UIView with some border color, and within it I stuck the segmented control. But I cant change the grey background ( which should be white ).
I tried doing all of this :
sc.selectedSegmentTintColor = UIColor.blue
sc.setTitleTextAttributes([NSAttributedString.Key.font: UIFont.preferredFont(forTextStyle: .body),NSAttributedString.Key.foregroundColor: UIColor.white], for: .selected)
sc.setTitleTextAttributes([NSAttributedString.Key.font: UIFont.preferredFont(forTextStyle: .body),NSAttributedString.Key.foregroundColor: UIColor.blue], for: .normal)
sc.tintColor = .white
sc.backgroundColor = .white
sc.isOpaque = true
with no success. :(
It's working fine with background color
self.backgroundColor = .red
It's working fine in iOS 13

how to get font color of a XSSF CELLSTYLE?

I am trying to get font color of cell of a XLSX file.
I am using the apache poi.
I am able to get the cell color but not the font color.
Any kind of suggestion will be appreciated.
thanks
From an XSSFCellStyle you can get the XSSFFont. From that, you can get the XSSFColor. Finally, from the XSSFColor, you can get the colour information as ARGB Hex, RGB with Tint etc.
Your code would look something like:
XSSFCellStyle style = cell.getCellStyle();
XSSFFont font = style.getFont();
XSSFColor colour = font.getXSSFColour();
System.out.println("The colour is " + colour.getARGBHex());

Blue color table border using docx4j

I'm using docx4j to create a docx file. I want my table border to be blue colored but it is only showing black.how to do this?
Here is my code:
table.setTblPr(new TblPr());
CTBorder border = new CTBorder();
border.setColor("FFF");
border.setSz(new BigInteger("0"));
border.setSpace(new BigInteger("0"));
border.setVal(STBorder.SINGLE);
TblBorders borders = new TblBorders();
borders.setBottom(border);
borders.setLeft(border);
borders.setRight(border);
borders.setTop(border);
borders.setInsideH(border);
borders.setInsideV(border);
table.getTblPr().setTblBorders(borders);
You need to set the color attribute of the border in question. Your example code appears to have you setting a colour of 'FFF' which obviously won't work if it needs to be blue! I would suggest trying a straight blue in hex and going from there. For example a (very) standard blue would be:
CTBorder border = new CTBorder();
border.setColor("0000FF");

Resources