#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Tue, 08 Aug 2017 16:01:20 +0200
changeset 8063 e335948608ed
parent 8062 abb27be500c2
child 8064 abdedfc08276
#FEATURE by stefan class: Color added: #hexPrintOn: changed: #hexPrintString
Color.st
--- a/Color.st	Tue Aug 08 14:17:28 2017 +0200
+++ b/Color.st	Tue Aug 08 16:01:20 2017 +0200
@@ -5488,22 +5488,29 @@
     ^ self hexPrintString
 !
 
+hexPrintOn:aStream
+    "print a base16 representation on aStream as rrggbb"
+
+    red isNil ifTrue:[
+        colorId notNil ifTrue:[
+            colorId printOn:aStream base:16 size:6 fill:$0.
+        ]
+    ] ifFalse:[
+        self redByte   printOn:aStream base:16 size:2 fill:$0.
+        self greenByte printOn:aStream base:16 size:2 fill:$0.
+        self blueByte  printOn:aStream base:16 size:2 fill:$0.
+    ].
+
+    "Created: / 08-08-2017 / 15:58:52 / stefan"
+!
+
 hexPrintString
     "return a hex-printString as rrggbb"
 
     |s|
 
     s := WriteStream on:(String new:6).
-    red isNil ifTrue:[
-	colorId notNil ifTrue:[
-	    colorId printOn:s base:16 size:6 fill:$0.
-	]
-    ] ifFalse:[
-	self redByte   printOn:s base:16 size:2 fill:$0.
-	self greenByte printOn:s base:16 size:2 fill:$0.
-	self blueByte  printOn:s base:16 size:2 fill:$0.
-    ].
-
+    self hexPrintOn:s.
     ^ s contents.
 
     "
@@ -5512,6 +5519,8 @@
      Color blue hexPrintString
      Color yellow hexPrintString
     "
+
+    "Modified: / 08-08-2017 / 15:59:38 / stefan"
 !
 
 htmlPrintString