| 
									
										
										
										
											2022-10-03 16:25:42 +00:00
										 |  |  | #include "stopelement.h"
 | 
					
						
							|  |  |  | #include "parser.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace lunasvg { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | StopElement::StopElement() | 
					
						
							| 
									
										
										
										
											2022-10-16 10:31:43 +00:00
										 |  |  |     : StyledElement(ElementID::Stop) | 
					
						
							| 
									
										
										
										
											2022-10-03 16:25:42 +00:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | double StopElement::offset() const | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-10-16 10:31:43 +00:00
										 |  |  |     auto& value = get(PropertyID::Offset); | 
					
						
							| 
									
										
										
										
											2022-10-03 16:25:42 +00:00
										 |  |  |     return Parser::parseNumberPercentage(value, 0.0); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Color StopElement::stopColorWithOpacity() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     auto color = stop_color(); | 
					
						
							| 
									
										
										
										
											2022-10-16 10:31:43 +00:00
										 |  |  |     color.combine(stop_opacity()); | 
					
						
							| 
									
										
										
										
											2022-10-03 16:25:42 +00:00
										 |  |  |     return color; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::unique_ptr<Node> StopElement::clone() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return cloneElement<StopElement>(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace lunasvg
 |