mikhailemv

Untitled

Dec 6th, 2021
807
319 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using GeometryTasks;
  8.  
  9. namespace GeometryPainting
  10. {
  11.     static class SegmentExtensions
  12.     {
  13.         public static Dictionary<Segment, Color> SegmentAndColorMatching = new Dictionary<Segment, Color>();
  14.  
  15.         public static void SetColor(this Segment segment, Color colors)
  16.         {
  17.             SegmentAndColorMatching[segment] = colors;
  18.         }
  19.  
  20.         public static Color GetColor(this Segment segment)
  21.         {
  22.             if (SegmentAndColorMatching.ContainsKey(segment))
  23.                 return SegmentAndColorMatching[segment];
  24.             else
  25.                 return Color.Black;      
  26.         }
  27.     }
  28. }
RAW Paste Data